code_ownership 2.1.4 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (505) hide show
  1. checksums.yaml +4 -4
  2. data/.cargo/config +2 -2
  3. data/Cargo.lock +6 -59
  4. data/ext/cargo-vendor/codeowners-0.5.0/.cargo-checksum.json +1 -0
  5. data/ext/cargo-vendor/codeowners-0.5.0/.github/workflows/audit.yml +31 -0
  6. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/.github/workflows/ci.yml +11 -0
  7. data/ext/cargo-vendor/codeowners-0.5.0/.github/workflows/codeql.yml +21 -0
  8. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/Cargo.lock +27 -115
  9. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/Cargo.toml +44 -3
  10. data/ext/cargo-vendor/codeowners-0.5.0/perf/README.md +204 -0
  11. data/ext/cargo-vendor/codeowners-0.5.0/perf/compare.sh +23 -0
  12. data/ext/cargo-vendor/codeowners-0.5.0/perf/run.sh +28 -0
  13. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/rust-toolchain.toml +1 -1
  14. data/ext/cargo-vendor/codeowners-0.5.0/src/bin/codeowners-perf.rs +719 -0
  15. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/src/cache/file.rs +9 -9
  16. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/src/cache/mod.rs +4 -4
  17. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/src/cache/noop.rs +4 -4
  18. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/src/cli.rs +7 -7
  19. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/src/main.rs +3 -3
  20. data/ext/cargo-vendor/codeowners-0.5.0/src/ownership/file_owner_resolver.rs +829 -0
  21. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/src/ownership/validator.rs +108 -15
  22. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/src/ownership.rs +22 -3
  23. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/src/project.rs +4 -4
  24. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/src/project_builder.rs +40 -14
  25. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/src/project_file_builder.rs +2 -2
  26. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/src/runner/api.rs +8 -5
  27. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/src/runner/types.rs +1 -2
  28. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/src/runner.rs +39 -29
  29. data/ext/cargo-vendor/codeowners-0.5.0/tests/annotation_in_unowned_team_glob_test.rs +64 -0
  30. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/common/mod.rs +1 -1
  31. data/ext/cargo-vendor/codeowners-0.5.0/tests/directory_codeowner_github_team_test.rs +22 -0
  32. data/ext/cargo-vendor/codeowners-0.5.0/tests/empty_directory_codeowner_test.rs +26 -0
  33. data/ext/cargo-vendor/codeowners-0.5.0/tests/fixtures/annotation_in_unowned_team_glob/.github/CODEOWNERS +18 -0
  34. data/ext/cargo-vendor/codeowners-0.5.0/tests/fixtures/annotation_in_unowned_team_glob/config/code_ownership.yml +4 -0
  35. data/ext/cargo-vendor/codeowners-0.5.0/tests/fixtures/annotation_in_unowned_team_glob/config/teams/alpha.yml +7 -0
  36. data/ext/cargo-vendor/codeowners-0.5.0/tests/fixtures/annotation_in_unowned_team_glob/config/teams/beta.yml +3 -0
  37. data/ext/cargo-vendor/codeowners-0.5.0/tests/fixtures/annotation_in_unowned_team_glob/ruby/app/services/alpha_owned.rb +2 -0
  38. data/ext/cargo-vendor/codeowners-0.5.0/tests/fixtures/annotation_in_unowned_team_glob/ruby/app/services/beta_owned.rb +4 -0
  39. data/ext/cargo-vendor/codeowners-0.5.0/tests/fixtures/directory-codeowner-github-team/.github/CODEOWNERS +15 -0
  40. data/ext/cargo-vendor/codeowners-0.5.0/tests/fixtures/directory-codeowner-github-team/app/by_handle/.codeowner +1 -0
  41. data/ext/cargo-vendor/codeowners-0.5.0/tests/fixtures/directory-codeowner-github-team/app/by_handle/handled.rb +2 -0
  42. data/ext/cargo-vendor/codeowners-0.5.0/tests/fixtures/directory-codeowner-github-team/app/by_name/named.rb +2 -0
  43. data/ext/cargo-vendor/codeowners-0.5.0/tests/fixtures/empty-directory-codeowner/.github/CODEOWNERS +14 -0
  44. data/ext/cargo-vendor/codeowners-0.5.0/tests/fixtures/empty-directory-codeowner/app/services/.codeowner +1 -0
  45. data/ext/cargo-vendor/codeowners-0.5.0/tests/fixtures/empty-directory-codeowner/app/services/nested/.codeowner +1 -0
  46. data/ext/cargo-vendor/codeowners-0.5.0/tests/fixtures/empty-directory-codeowner/app/services/nested/nested_file.rb +2 -0
  47. data/ext/cargo-vendor/codeowners-0.5.0/tests/fixtures/empty-directory-codeowner/config/code_ownership.yml +10 -0
  48. data/ext/cargo-vendor/codeowners-0.5.0/tests/fixtures/empty-directory-codeowner/config/teams/foo.yml +5 -0
  49. data/ext/cargo-vendor/codeowners-0.5.0/tests/fixtures/invalid-directory-codeowner/.github/CODEOWNERS +14 -0
  50. data/ext/cargo-vendor/codeowners-0.5.0/tests/fixtures/invalid-directory-codeowner/app/services/.codeowner +1 -0
  51. data/ext/cargo-vendor/codeowners-0.5.0/tests/fixtures/invalid-directory-codeowner/app/services/nested/.codeowner +1 -0
  52. data/ext/cargo-vendor/codeowners-0.5.0/tests/fixtures/invalid-directory-codeowner/app/services/nested/nested_file.rb +2 -0
  53. data/ext/cargo-vendor/codeowners-0.5.0/tests/fixtures/invalid-directory-codeowner/config/code_ownership.yml +10 -0
  54. data/ext/cargo-vendor/codeowners-0.5.0/tests/fixtures/invalid-directory-codeowner/config/teams/foo.yml +5 -0
  55. data/ext/cargo-vendor/codeowners-0.5.0/tests/fixtures/multiple-directory-owners/app/services/.codeowner +1 -0
  56. data/ext/cargo-vendor/codeowners-0.5.0/tests/fixtures/multiple-directory-owners/config/code_ownership.yml +10 -0
  57. data/ext/cargo-vendor/codeowners-0.5.0/tests/fixtures/multiple-directory-owners/config/teams/foo.yml +5 -0
  58. data/ext/cargo-vendor/codeowners-0.5.0/tests/global_gitignore_test.rs +50 -0
  59. data/ext/cargo-vendor/codeowners-0.5.0/tests/invalid_directory_codeowner_test.rs +26 -0
  60. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/invalid_project_test.rs +9 -9
  61. data/ext/cargo-vendor/codeowners-0.5.0/tests/perf_harness_test.rs +245 -0
  62. data/ext/cargo-vendor/codeowners-0.5.0/tests/untracked_new_file_test.rs +63 -0
  63. data/ext/cargo-vendor/codeowners-0.5.0/tests/untracked_source_file_test.rs +40 -0
  64. data/ext/cargo-vendor/error-stack-0.8.0/.cargo-checksum.json +1 -0
  65. data/ext/cargo-vendor/error-stack-0.8.0/.cargo_vcs_info.json +6 -0
  66. data/ext/cargo-vendor/error-stack-0.8.0/.justfile +16 -0
  67. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/CHANGELOG.md +50 -1
  68. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/Cargo.lock +253 -310
  69. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/Cargo.toml +107 -52
  70. data/ext/cargo-vendor/error-stack-0.8.0/Cargo.toml.orig +109 -0
  71. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/README.md +16 -18
  72. data/ext/cargo-vendor/error-stack-0.8.0/build.rs +28 -0
  73. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/examples/demo.rs +21 -19
  74. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/examples/detect.rs +6 -6
  75. data/ext/cargo-vendor/error-stack-0.8.0/examples/exit_code.rs +25 -0
  76. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/examples/parse_config.rs +5 -5
  77. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/src/compat/anyhow.rs +7 -7
  78. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/src/compat/eyre.rs +7 -6
  79. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/src/compat/mod.rs +7 -9
  80. data/ext/cargo-vendor/error-stack-0.8.0/src/context.rs +52 -0
  81. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/src/error.rs +2 -9
  82. data/ext/cargo-vendor/error-stack-0.8.0/src/ext/iter.rs +286 -0
  83. data/ext/cargo-vendor/error-stack-0.8.0/src/ext/mod.rs +19 -0
  84. data/ext/cargo-vendor/error-stack-0.8.0/src/ext/stream.rs +212 -0
  85. data/ext/cargo-vendor/error-stack-0.8.0/src/ext/tuple.rs +218 -0
  86. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/src/fmt/charset.rs +12 -12
  87. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/src/fmt/color.rs +30 -30
  88. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/src/fmt/config.rs +1 -1
  89. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/src/fmt/hook.rs +23 -24
  90. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/src/fmt/location.rs +3 -3
  91. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/src/fmt/mod.rs +62 -52
  92. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/src/frame/frame_impl.rs +12 -15
  93. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/src/frame/kind.rs +11 -10
  94. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/src/frame/mod.rs +8 -10
  95. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/src/future.rs +57 -63
  96. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/src/hook/context.rs +18 -20
  97. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/src/hook/mod.rs +16 -15
  98. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/src/iter.rs +12 -57
  99. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/src/lib.rs +99 -87
  100. data/ext/cargo-vendor/error-stack-0.8.0/src/macros.rs +212 -0
  101. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/src/report.rs +525 -207
  102. data/ext/cargo-vendor/error-stack-0.8.0/src/result.rs +137 -0
  103. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/src/serde.rs +53 -38
  104. data/ext/cargo-vendor/error-stack-0.8.0/src/sink.rs +672 -0
  105. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/common.rs +36 -24
  106. data/ext/cargo-vendor/error-stack-0.8.0/tests/compiletest.rs +22 -0
  107. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/doc/fmt__charset_ascii.snap +1 -1
  108. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/doc/fmt__charset_utf8.snap +1 -1
  109. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/doc/fmt__diagnostics_add.snap +1 -1
  110. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/doc/fmt__doc.snap +1 -1
  111. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/doc/fmt__emit.snap +1 -1
  112. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/doc/fmt__emit_alt.snap +1 -1
  113. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/doc/fmt__hookcontext_cast.snap +1 -1
  114. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/doc/fmt__hookcontext_decrement.snap +1 -1
  115. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/doc/fmt__hookcontext_emit.snap +1 -1
  116. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/doc/fmt__hookcontext_increment.snap +1 -1
  117. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/doc/fmt__hookcontext_storage.snap +1 -1
  118. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/doc/fmt__preference_color.snap +1 -1
  119. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/doc/fmt__preference_emphasis.snap +1 -1
  120. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/doc/fmt__preference_none.snap +1 -1
  121. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/doc/fmt_doc_alt.snap +1 -1
  122. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/doc/hook__debug_hook.snap +1 -1
  123. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/doc/hook__debug_hook_provide.snap +1 -1
  124. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/doc/lib__suggestion.snap +2 -2
  125. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/doc/report_debug__doc.snap +3 -3
  126. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/test_debug__full__complex.snap +1 -1
  127. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/test_debug__full__hook_location.snap +1 -1
  128. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/test_debug__full__linear.snap +2 -2
  129. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/test_debug__full__linear_ext.snap +2 -2
  130. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/test_debug__full__multiline_context.snap +3 -3
  131. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/test_debug__full__sources.snap +1 -1
  132. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/test_debug__full__sources_transparent.snap +1 -1
  133. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/test_debug__sources_nested.snap +10 -10
  134. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/test_debug__sources_nested@spantrace-backtrace.snap +10 -10
  135. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/test_debug__sources_nested_alternate.snap +10 -10
  136. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/test_debug__sources_nested_alternate@spantrace-backtrace.snap +10 -10
  137. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/test_serialize__attachment.snap +1 -1
  138. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/test_serialize__context.snap +1 -1
  139. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/test_serialize__multiple_sources.snap +2 -2
  140. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/test_serialize__multiple_sources_at_root.snap +2 -2
  141. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/test_attach.rs +41 -15
  142. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/test_attach_printable.rs +14 -15
  143. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/test_backtrace.rs +0 -1
  144. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/test_change_context.rs +31 -9
  145. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/test_compatibility.rs +8 -17
  146. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/test_conversion.rs +25 -3
  147. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/test_debug.rs +91 -91
  148. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/test_display.rs +8 -9
  149. data/ext/cargo-vendor/error-stack-0.8.0/tests/test_downcast.rs +101 -0
  150. data/ext/cargo-vendor/error-stack-0.8.0/tests/test_extend.rs +99 -0
  151. data/ext/cargo-vendor/error-stack-0.8.0/tests/test_frame.rs +136 -0
  152. data/ext/cargo-vendor/error-stack-0.8.0/tests/test_iter.rs +132 -0
  153. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/test_macros.rs +5 -31
  154. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/test_provision.rs +3 -2
  155. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/test_serialize.rs +14 -14
  156. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/test_span_trace.rs +10 -11
  157. data/ext/cargo-vendor/error-stack-0.8.0/tests/ui/attach_diagnostics.rs +21 -0
  158. data/ext/cargo-vendor/error-stack-0.8.0/tests/ui/attach_diagnostics.stderr +23 -0
  159. data/ext/cargo-vendor/error-stack-0.8.0/tests/ui/frames_mut_escape.rs +28 -0
  160. data/ext/cargo-vendor/error-stack-0.8.0/tests/ui/frames_mut_escape.stderr +13 -0
  161. data/ext/cargo-vendor/error-stack-0.8.0/tests/ui/macro_invalid_args.rs +32 -0
  162. data/ext/cargo-vendor/error-stack-0.8.0/tests/ui/macro_invalid_args.stderr +132 -0
  163. data/ext/cargo-vendor/error-stack-0.8.0/tests/ui/missing_args.rs +32 -0
  164. data/ext/cargo-vendor/error-stack-0.8.0/tests/ui/missing_args.stderr +35 -0
  165. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/ui/must_use.rs +3 -3
  166. data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/ui/must_use.stderr +1 -1
  167. data/ext/code_ownership/Cargo.toml +1 -1
  168. data/ext/code_ownership/src/lib.rs +13 -1
  169. data/lib/code_ownership/version.rb +1 -1
  170. data/lib/code_ownership.rb +3 -0
  171. metadata +340 -431
  172. data/ext/cargo-vendor/ahash-0.7.8/.cargo-checksum.json +0 -1
  173. data/ext/cargo-vendor/ahash-0.7.8/.cargo_vcs_info.json +0 -6
  174. data/ext/cargo-vendor/ahash-0.7.8/.github/workflows/rust.yml +0 -151
  175. data/ext/cargo-vendor/ahash-0.7.8/Cargo.toml +0 -149
  176. data/ext/cargo-vendor/ahash-0.7.8/Cargo.toml.orig +0 -96
  177. data/ext/cargo-vendor/ahash-0.7.8/FAQ.md +0 -118
  178. data/ext/cargo-vendor/ahash-0.7.8/LICENSE-APACHE +0 -201
  179. data/ext/cargo-vendor/ahash-0.7.8/LICENSE-MIT +0 -25
  180. data/ext/cargo-vendor/ahash-0.7.8/README.md +0 -110
  181. data/ext/cargo-vendor/ahash-0.7.8/build.rs +0 -47
  182. data/ext/cargo-vendor/ahash-0.7.8/rustfmt.toml +0 -1
  183. data/ext/cargo-vendor/ahash-0.7.8/src/aes_hash.rs +0 -440
  184. data/ext/cargo-vendor/ahash-0.7.8/src/convert.rs +0 -167
  185. data/ext/cargo-vendor/ahash-0.7.8/src/fallback_hash.rs +0 -392
  186. data/ext/cargo-vendor/ahash-0.7.8/src/hash_map.rs +0 -371
  187. data/ext/cargo-vendor/ahash-0.7.8/src/hash_quality_test.rs +0 -517
  188. data/ext/cargo-vendor/ahash-0.7.8/src/hash_set.rs +0 -313
  189. data/ext/cargo-vendor/ahash-0.7.8/src/lib.rs +0 -263
  190. data/ext/cargo-vendor/ahash-0.7.8/src/operations.rs +0 -330
  191. data/ext/cargo-vendor/ahash-0.7.8/src/random_state.rs +0 -363
  192. data/ext/cargo-vendor/ahash-0.7.8/src/specialize.rs +0 -239
  193. data/ext/cargo-vendor/ahash-0.7.8/tests/bench.rs +0 -154
  194. data/ext/cargo-vendor/ahash-0.7.8/tests/map_tests.rs +0 -203
  195. data/ext/cargo-vendor/ahash-0.7.8/tests/nopanic.rs +0 -72
  196. data/ext/cargo-vendor/codeowners-0.3.3/.cargo-checksum.json +0 -1
  197. data/ext/cargo-vendor/codeowners-0.3.3/.github/workflows/audit.yml +0 -19
  198. data/ext/cargo-vendor/codeowners-0.3.3/src/ownership/file_owner_resolver.rs +0 -416
  199. data/ext/cargo-vendor/error-stack-0.5.0/.cargo-checksum.json +0 -1
  200. data/ext/cargo-vendor/error-stack-0.5.0/.cargo_vcs_info.json +0 -6
  201. data/ext/cargo-vendor/error-stack-0.5.0/.justfile +0 -58
  202. data/ext/cargo-vendor/error-stack-0.5.0/Cargo.toml.orig +0 -87
  203. data/ext/cargo-vendor/error-stack-0.5.0/build.rs +0 -29
  204. data/ext/cargo-vendor/error-stack-0.5.0/examples/exit_code.rs +0 -24
  205. data/ext/cargo-vendor/error-stack-0.5.0/rust-toolchain.toml +0 -4
  206. data/ext/cargo-vendor/error-stack-0.5.0/src/context.rs +0 -132
  207. data/ext/cargo-vendor/error-stack-0.5.0/src/macros.rs +0 -253
  208. data/ext/cargo-vendor/error-stack-0.5.0/src/result.rs +0 -267
  209. data/ext/cargo-vendor/error-stack-0.5.0/tests/compiletest.rs +0 -7
  210. data/ext/cargo-vendor/error-stack-0.5.0/tests/snapshots/test_debug__sources_nested@backtrace.snap +0 -104
  211. data/ext/cargo-vendor/error-stack-0.5.0/tests/snapshots/test_debug__sources_nested@spantrace.snap +0 -104
  212. data/ext/cargo-vendor/error-stack-0.5.0/tests/snapshots/test_debug__sources_nested_alternate@backtrace.snap +0 -104
  213. data/ext/cargo-vendor/error-stack-0.5.0/tests/snapshots/test_debug__sources_nested_alternate@spantrace.snap +0 -104
  214. data/ext/cargo-vendor/error-stack-0.5.0/tests/test_downcast.rs +0 -41
  215. data/ext/cargo-vendor/error-stack-0.5.0/tests/test_extend.rs +0 -78
  216. data/ext/cargo-vendor/error-stack-0.5.0/tests/test_frame.rs +0 -126
  217. data/ext/cargo-vendor/error-stack-0.5.0/tests/test_iter.rs +0 -99
  218. data/ext/cargo-vendor/error-stack-0.5.0/tests/ui/macro_invalid_args.rs +0 -60
  219. data/ext/cargo-vendor/error-stack-0.5.0/tests/ui/macro_invalid_args.stderr +0 -101
  220. data/ext/cargo-vendor/getrandom-0.2.16/.cargo-checksum.json +0 -1
  221. data/ext/cargo-vendor/getrandom-0.2.16/.cargo_vcs_info.json +0 -6
  222. data/ext/cargo-vendor/getrandom-0.2.16/CHANGELOG.md +0 -498
  223. data/ext/cargo-vendor/getrandom-0.2.16/Cargo.lock +0 -354
  224. data/ext/cargo-vendor/getrandom-0.2.16/Cargo.toml +0 -121
  225. data/ext/cargo-vendor/getrandom-0.2.16/Cargo.toml.orig +0 -67
  226. data/ext/cargo-vendor/getrandom-0.2.16/LICENSE-APACHE +0 -201
  227. data/ext/cargo-vendor/getrandom-0.2.16/LICENSE-MIT +0 -26
  228. data/ext/cargo-vendor/getrandom-0.2.16/README.md +0 -81
  229. data/ext/cargo-vendor/getrandom-0.2.16/SECURITY.md +0 -13
  230. data/ext/cargo-vendor/getrandom-0.2.16/benches/buffer.rs +0 -71
  231. data/ext/cargo-vendor/getrandom-0.2.16/src/apple-other.rs +0 -24
  232. data/ext/cargo-vendor/getrandom-0.2.16/src/custom.rs +0 -105
  233. data/ext/cargo-vendor/getrandom-0.2.16/src/error.rs +0 -189
  234. data/ext/cargo-vendor/getrandom-0.2.16/src/error_impls.rs +0 -15
  235. data/ext/cargo-vendor/getrandom-0.2.16/src/espidf.rs +0 -18
  236. data/ext/cargo-vendor/getrandom-0.2.16/src/fuchsia.rs +0 -13
  237. data/ext/cargo-vendor/getrandom-0.2.16/src/getentropy.rs +0 -21
  238. data/ext/cargo-vendor/getrandom-0.2.16/src/getrandom.rs +0 -25
  239. data/ext/cargo-vendor/getrandom-0.2.16/src/hermit.rs +0 -29
  240. data/ext/cargo-vendor/getrandom-0.2.16/src/js.rs +0 -155
  241. data/ext/cargo-vendor/getrandom-0.2.16/src/lazy.rs +0 -56
  242. data/ext/cargo-vendor/getrandom-0.2.16/src/lib.rs +0 -407
  243. data/ext/cargo-vendor/getrandom-0.2.16/src/linux_android.rs +0 -7
  244. data/ext/cargo-vendor/getrandom-0.2.16/src/linux_android_with_fallback.rs +0 -33
  245. data/ext/cargo-vendor/getrandom-0.2.16/src/netbsd.rs +0 -46
  246. data/ext/cargo-vendor/getrandom-0.2.16/src/rdrand.rs +0 -121
  247. data/ext/cargo-vendor/getrandom-0.2.16/src/solaris.rs +0 -34
  248. data/ext/cargo-vendor/getrandom-0.2.16/src/solid.rs +0 -18
  249. data/ext/cargo-vendor/getrandom-0.2.16/src/use_file.rs +0 -120
  250. data/ext/cargo-vendor/getrandom-0.2.16/src/util.rs +0 -35
  251. data/ext/cargo-vendor/getrandom-0.2.16/src/util_libc.rs +0 -162
  252. data/ext/cargo-vendor/getrandom-0.2.16/src/vxworks.rs +0 -29
  253. data/ext/cargo-vendor/getrandom-0.2.16/src/wasi.rs +0 -17
  254. data/ext/cargo-vendor/getrandom-0.2.16/src/windows.rs +0 -59
  255. data/ext/cargo-vendor/getrandom-0.2.16/tests/common/mod.rs +0 -100
  256. data/ext/cargo-vendor/getrandom-0.2.16/tests/custom.rs +0 -54
  257. data/ext/cargo-vendor/getrandom-0.2.16/tests/normal.rs +0 -11
  258. data/ext/cargo-vendor/getrandom-0.2.16/tests/rdrand.rs +0 -22
  259. data/ext/cargo-vendor/hashbrown-0.12.3/.cargo-checksum.json +0 -1
  260. data/ext/cargo-vendor/hashbrown-0.12.3/.cargo_vcs_info.json +0 -6
  261. data/ext/cargo-vendor/hashbrown-0.12.3/CHANGELOG.md +0 -402
  262. data/ext/cargo-vendor/hashbrown-0.12.3/Cargo.toml +0 -113
  263. data/ext/cargo-vendor/hashbrown-0.12.3/Cargo.toml.orig +0 -60
  264. data/ext/cargo-vendor/hashbrown-0.12.3/LICENSE-APACHE +0 -201
  265. data/ext/cargo-vendor/hashbrown-0.12.3/LICENSE-MIT +0 -25
  266. data/ext/cargo-vendor/hashbrown-0.12.3/README.md +0 -126
  267. data/ext/cargo-vendor/hashbrown-0.12.3/benches/bench.rs +0 -331
  268. data/ext/cargo-vendor/hashbrown-0.12.3/benches/insert_unique_unchecked.rs +0 -32
  269. data/ext/cargo-vendor/hashbrown-0.12.3/clippy.toml +0 -1
  270. data/ext/cargo-vendor/hashbrown-0.12.3/src/external_trait_impls/mod.rs +0 -4
  271. data/ext/cargo-vendor/hashbrown-0.12.3/src/external_trait_impls/rayon/helpers.rs +0 -27
  272. data/ext/cargo-vendor/hashbrown-0.12.3/src/external_trait_impls/rayon/map.rs +0 -734
  273. data/ext/cargo-vendor/hashbrown-0.12.3/src/external_trait_impls/rayon/mod.rs +0 -4
  274. data/ext/cargo-vendor/hashbrown-0.12.3/src/external_trait_impls/rayon/raw.rs +0 -231
  275. data/ext/cargo-vendor/hashbrown-0.12.3/src/external_trait_impls/rayon/set.rs +0 -659
  276. data/ext/cargo-vendor/hashbrown-0.12.3/src/external_trait_impls/serde.rs +0 -201
  277. data/ext/cargo-vendor/hashbrown-0.12.3/src/lib.rs +0 -150
  278. data/ext/cargo-vendor/hashbrown-0.12.3/src/macros.rs +0 -70
  279. data/ext/cargo-vendor/hashbrown-0.12.3/src/map.rs +0 -8408
  280. data/ext/cargo-vendor/hashbrown-0.12.3/src/raw/alloc.rs +0 -73
  281. data/ext/cargo-vendor/hashbrown-0.12.3/src/raw/bitmask.rs +0 -122
  282. data/ext/cargo-vendor/hashbrown-0.12.3/src/raw/generic.rs +0 -154
  283. data/ext/cargo-vendor/hashbrown-0.12.3/src/raw/mod.rs +0 -2460
  284. data/ext/cargo-vendor/hashbrown-0.12.3/src/raw/sse2.rs +0 -146
  285. data/ext/cargo-vendor/hashbrown-0.12.3/src/rustc_entry.rs +0 -630
  286. data/ext/cargo-vendor/hashbrown-0.12.3/src/scopeguard.rs +0 -74
  287. data/ext/cargo-vendor/hashbrown-0.12.3/src/set.rs +0 -2790
  288. data/ext/cargo-vendor/hashbrown-0.12.3/tests/hasher.rs +0 -65
  289. data/ext/cargo-vendor/hashbrown-0.12.3/tests/rayon.rs +0 -533
  290. data/ext/cargo-vendor/hashbrown-0.12.3/tests/serde.rs +0 -65
  291. data/ext/cargo-vendor/hashbrown-0.12.3/tests/set.rs +0 -34
  292. data/ext/cargo-vendor/lru-0.7.8/.cargo-checksum.json +0 -1
  293. data/ext/cargo-vendor/lru-0.7.8/.cargo_vcs_info.json +0 -6
  294. data/ext/cargo-vendor/lru-0.7.8/.github/workflows/main.yml +0 -54
  295. data/ext/cargo-vendor/lru-0.7.8/CHANGELOG.md +0 -194
  296. data/ext/cargo-vendor/lru-0.7.8/Cargo.toml +0 -42
  297. data/ext/cargo-vendor/lru-0.7.8/Cargo.toml.orig +0 -22
  298. data/ext/cargo-vendor/lru-0.7.8/LICENSE +0 -21
  299. data/ext/cargo-vendor/lru-0.7.8/README.md +0 -62
  300. data/ext/cargo-vendor/lru-0.7.8/src/lib.rs +0 -1872
  301. data/ext/cargo-vendor/version_check-0.9.5/.cargo-checksum.json +0 -1
  302. data/ext/cargo-vendor/version_check-0.9.5/.cargo_vcs_info.json +0 -6
  303. data/ext/cargo-vendor/version_check-0.9.5/.github/workflows/ci.yml +0 -42
  304. data/ext/cargo-vendor/version_check-0.9.5/.travis.yml +0 -6
  305. data/ext/cargo-vendor/version_check-0.9.5/Cargo.toml +0 -38
  306. data/ext/cargo-vendor/version_check-0.9.5/Cargo.toml.orig +0 -13
  307. data/ext/cargo-vendor/version_check-0.9.5/LICENSE-APACHE +0 -201
  308. data/ext/cargo-vendor/version_check-0.9.5/LICENSE-MIT +0 -19
  309. data/ext/cargo-vendor/version_check-0.9.5/README.md +0 -80
  310. data/ext/cargo-vendor/version_check-0.9.5/src/channel.rs +0 -195
  311. data/ext/cargo-vendor/version_check-0.9.5/src/date.rs +0 -203
  312. data/ext/cargo-vendor/version_check-0.9.5/src/lib.rs +0 -528
  313. data/ext/cargo-vendor/version_check-0.9.5/src/version.rs +0 -316
  314. data/ext/cargo-vendor/wasi-0.11.1+wasi-snapshot-preview1/.cargo-checksum.json +0 -1
  315. data/ext/cargo-vendor/wasi-0.11.1+wasi-snapshot-preview1/.cargo_vcs_info.json +0 -6
  316. data/ext/cargo-vendor/wasi-0.11.1+wasi-snapshot-preview1/.github/workflows/main.yml +0 -44
  317. data/ext/cargo-vendor/wasi-0.11.1+wasi-snapshot-preview1/.gitmodules +0 -3
  318. data/ext/cargo-vendor/wasi-0.11.1+wasi-snapshot-preview1/CODE_OF_CONDUCT.md +0 -49
  319. data/ext/cargo-vendor/wasi-0.11.1+wasi-snapshot-preview1/CONTRIBUTING.md +0 -8
  320. data/ext/cargo-vendor/wasi-0.11.1+wasi-snapshot-preview1/Cargo.lock +0 -23
  321. data/ext/cargo-vendor/wasi-0.11.1+wasi-snapshot-preview1/Cargo.toml +0 -59
  322. data/ext/cargo-vendor/wasi-0.11.1+wasi-snapshot-preview1/Cargo.toml.orig +0 -29
  323. data/ext/cargo-vendor/wasi-0.11.1+wasi-snapshot-preview1/LICENSE-APACHE +0 -201
  324. data/ext/cargo-vendor/wasi-0.11.1+wasi-snapshot-preview1/LICENSE-Apache-2.0_WITH_LLVM-exception +0 -220
  325. data/ext/cargo-vendor/wasi-0.11.1+wasi-snapshot-preview1/LICENSE-MIT +0 -23
  326. data/ext/cargo-vendor/wasi-0.11.1+wasi-snapshot-preview1/ORG_CODE_OF_CONDUCT.md +0 -143
  327. data/ext/cargo-vendor/wasi-0.11.1+wasi-snapshot-preview1/README.md +0 -94
  328. data/ext/cargo-vendor/wasi-0.11.1+wasi-snapshot-preview1/SECURITY.md +0 -29
  329. data/ext/cargo-vendor/wasi-0.11.1+wasi-snapshot-preview1/src/lib.rs +0 -47
  330. data/ext/cargo-vendor/wasi-0.11.1+wasi-snapshot-preview1/src/lib_generated.rs +0 -2366
  331. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/.github/CODEOWNERS +0 -0
  332. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/.github/workflows/dotslash-config.json +0 -0
  333. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/.rustfmt.toml +0 -0
  334. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/.rusty-hook.toml +0 -0
  335. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/AGENTS.md +0 -0
  336. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/CLAUDE.md +0 -0
  337. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/README.md +0 -0
  338. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/dev/run_benchmarks_for_file.sh +0 -0
  339. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/dev/run_benchmarks_for_gv.sh +0 -0
  340. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/src/common_test.rs +0 -0
  341. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/src/config.rs +0 -0
  342. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/src/crosscheck.rs +0 -0
  343. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/src/lib.rs +0 -0
  344. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/src/ownership/codeowners_file_parser.rs +0 -0
  345. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/src/ownership/codeowners_query.rs +0 -0
  346. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/src/ownership/file_generator.rs +0 -0
  347. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/src/ownership/file_owner_finder.rs +0 -0
  348. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/src/ownership/mapper/annotated_file_mapper.rs +0 -0
  349. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/src/ownership/mapper/directory_mapper.rs +0 -0
  350. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/src/ownership/mapper/escaper.rs +0 -0
  351. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/src/ownership/mapper/package_mapper.rs +0 -0
  352. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/src/ownership/mapper/team_gem_mapper.rs +0 -0
  353. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/src/ownership/mapper/team_glob_mapper.rs +0 -0
  354. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/src/ownership/mapper/team_yml_mapper.rs +0 -0
  355. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/src/ownership/mapper.rs +0 -0
  356. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/src/path_utils.rs +0 -0
  357. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/src/tracked_files.rs +0 -0
  358. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/cache_test.rs +0 -0
  359. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/codeowners_path_test.rs +0 -0
  360. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/crosscheck_owners_test.rs +0 -0
  361. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/executable_name_config_test.rs +10 -10
  362. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/custom_codeowners_path/config/code_ownership.yml +0 -0
  363. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/custom_codeowners_path/config/teams/test_team.yml +0 -0
  364. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/custom_codeowners_path/docs/CODEOWNERS +3 -3
  365. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/custom_codeowners_path/expected/CODEOWNERS +3 -3
  366. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/custom_codeowners_path/ruby/app/models/test.rb +0 -0
  367. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/custom_executable_name/.github/CODEOWNERS +0 -0
  368. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/custom_executable_name/app/foo.rb +0 -0
  369. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/custom_executable_name/config/code_ownership.yml +0 -0
  370. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/custom_executable_name/config/teams/foo.yml +0 -0
  371. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/custom_executable_name/config/teams/payments.yml +0 -0
  372. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/custom_executable_name/ruby/app/payments/foo.rb +0 -0
  373. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/default_executable_name/.github/CODEOWNERS +0 -0
  374. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/default_executable_name/app/bar.rb +0 -0
  375. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/default_executable_name/config/code_ownership.yml +0 -0
  376. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/default_executable_name/config/teams/bar.yml +0 -0
  377. data/ext/cargo-vendor/{codeowners-0.3.3/tests/fixtures/multiple-directory-owners/app/services → codeowners-0.5.0/tests/fixtures/directory-codeowner-github-team/app/by_name}/.codeowner +0 -0
  378. data/ext/cargo-vendor/{codeowners-0.3.3/tests/fixtures/multiple-directory-owners → codeowners-0.5.0/tests/fixtures/directory-codeowner-github-team}/config/code_ownership.yml +0 -0
  379. data/ext/cargo-vendor/{codeowners-0.3.3/tests/fixtures/multiple-directory-owners → codeowners-0.5.0/tests/fixtures/directory-codeowner-github-team}/config/teams/foo.yml +0 -0
  380. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/invalid_project/.github/CODEOWNERS +0 -0
  381. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/invalid_project/config/code_ownership.yml +0 -0
  382. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/invalid_project/config/teams/payments.yml +0 -0
  383. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/invalid_project/config/teams/payroll.yml +0 -0
  384. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/invalid_project/gems/payroll_calculator/calculator.rb +0 -0
  385. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/invalid_project/ruby/app/models/bank_account.rb +0 -0
  386. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/invalid_project/ruby/app/models/blockchain.rb +0 -0
  387. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/invalid_project/ruby/app/models/payroll.rb +0 -0
  388. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/invalid_project/ruby/app/payments/nacha.rb +0 -0
  389. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/invalid_project/ruby/app/services/.codeowner +0 -0
  390. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/invalid_project/ruby/app/services/multi_owned.rb +0 -0
  391. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/invalid_project/ruby/app/unowned.rb +0 -0
  392. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/invalid_project/ruby/packages/payroll_flow/package.yml +0 -0
  393. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/javascript_only_project/.github/CODEOWNERS +0 -0
  394. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/javascript_only_project/.keep +0 -0
  395. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/javascript_only_project/config/code_ownership.yml +0 -0
  396. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/javascript_only_project/config/teams/design.yml +0 -0
  397. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/javascript_only_project/config/teams/frontend.yml +0 -0
  398. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/javascript_only_project/frontend/apps/public/index.tsx +0 -0
  399. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/javascript_only_project/frontend/packages/dashboard/package.json +0 -0
  400. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/javascript_only_project/frontend/packages/dashboard/src/index.tsx +0 -0
  401. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/javascript_only_project/frontend/packages/ui-kit/.codeowner +0 -0
  402. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/javascript_only_project/frontend/packages/ui-kit/src/button.tsx +0 -0
  403. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/missing_github_team/.github/CODEOWNERS +0 -0
  404. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/missing_github_team/config/code_ownership.yml +0 -0
  405. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/missing_github_team/config/teams/bad_team.yml +0 -0
  406. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/missing_github_team/config/teams/good.yml +0 -0
  407. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/missing_github_team/gems/pets/dog.rb +0 -0
  408. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/multiple-directory-owners/.github/CODEOWNERS +0 -0
  409. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/multiple-directory-owners/app/consumers/.codeowner +0 -0
  410. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/multiple-directory-owners/app/consumers/deep/nesting/nestdir/deep_file.rb +0 -0
  411. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/multiple-directory-owners/app/consumers/one_owner.rb +0 -0
  412. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/multiple-directory-owners/app/services/exciting/.codeowner +0 -0
  413. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/multiple-directory-owners/app/services/exciting/some_other_file.rb +0 -0
  414. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/multiple-directory-owners/config/teams/bar.yml +0 -0
  415. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project/.github/CODEOWNERS +9 -9
  416. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project/.ignore +0 -0
  417. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project/config/code_ownership.yml +0 -0
  418. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project/config/teams/payments.yml +0 -0
  419. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project/config/teams/payroll.yml +0 -0
  420. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project/config/teams/ux.yml +0 -0
  421. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project/gems/payroll_calculator/calculator.rb +0 -0
  422. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project/gems/pets/dog.rb +0 -0
  423. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project/javascript/packages/PayrollFlow/index.tsx +0 -0
  424. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project/javascript/packages/PayrollFlow/package.json +0 -0
  425. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project/javascript/packages/items/(special)/.codeowner +0 -0
  426. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project/javascript/packages/items/(special)/pay.ts +0 -0
  427. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project/javascript/packages/items/.codeowner +0 -0
  428. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project/javascript/packages/items/item.ts +0 -0
  429. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project/javascript/packages/list/page-admin.tsx +0 -0
  430. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project/ruby/app/models/bank_account.rb +0 -0
  431. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project/ruby/app/models/payroll.rb +0 -0
  432. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project/ruby/app/payments/foo/.codeowner +0 -0
  433. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project/ruby/app/payments/foo/ownedby_payroll.rb +0 -0
  434. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project/ruby/app/payments/nacha.rb +0 -0
  435. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project/ruby/app/payroll/.codeowner +0 -0
  436. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project/ruby/app/payroll/payroll.rb +0 -0
  437. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project/ruby/app/views/foos/edit.erb +0 -0
  438. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project/ruby/app/views/foos/index.html.erb +0 -0
  439. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project/ruby/app/views/foos/new.html.erb +0 -0
  440. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project/ruby/ignored_files/git_ignored.rb +0 -0
  441. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project/ruby/packages/payroll_flow/package.yml +0 -0
  442. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project/should_be_ignored/an_ignored_file.rb +0 -0
  443. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project_with_overrides/.github/CODEOWNERS +12 -12
  444. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project_with_overrides/config/code_ownership.yml +0 -0
  445. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project_with_overrides/config/teams/brewers.yml +0 -0
  446. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project_with_overrides/config/teams/cubs.yml +0 -0
  447. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project_with_overrides/config/teams/giants.yml +0 -0
  448. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project_with_overrides/config/teams/rockies.yml +0 -0
  449. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project_with_overrides/frontend/packages/components/datepicker/package.json +0 -0
  450. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project_with_overrides/frontend/packages/components/datepicker/src/picks/dp.tsx +0 -0
  451. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project_with_overrides/frontend/packages/components/list/package.json +0 -0
  452. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project_with_overrides/frontend/packages/components/list/src/item.tsx +0 -0
  453. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project_with_overrides/frontend/packages/components/textfield/package.json +0 -0
  454. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project_with_overrides/frontend/packages/components/textfield/src/field.tsx +0 -0
  455. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project_with_overrides/frontend/packages/components/textfield/src/fields/small.tsx +0 -0
  456. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project_with_overrides/gems/apollo/lib/apollo.rb +0 -0
  457. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project_with_overrides/gems/ivy/lib/ivy.rb +0 -0
  458. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project_with_overrides/gems/lager/lib/lager.rb +0 -0
  459. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project_with_overrides/gems/summit/lib/summit.rb +0 -0
  460. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project_with_overrides/packs/games/app/services/stats.rb +0 -0
  461. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project_with_overrides/packs/games/package.yml +0 -0
  462. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project_with_overrides/packs/locations/app/services/capacity.rb +0 -0
  463. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project_with_overrides/packs/locations/package.yml +0 -0
  464. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project_with_overrides/packs/schedule/app/services/date.rb +0 -0
  465. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project_with_overrides/packs/schedule/package.yml +0 -0
  466. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project_with_overrides/ruby/app/brewers/lib/util.rb +0 -0
  467. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project_with_overrides/ruby/app/brewers/services/play.rb +0 -0
  468. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project_with_overrides/ruby/app/cubs/.codeowner +0 -0
  469. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project_with_overrides/ruby/app/cubs/services/models/.codeowner +0 -0
  470. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project_with_overrides/ruby/app/cubs/services/models/db/price.rb +0 -0
  471. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project_with_overrides/ruby/app/cubs/services/models/entertainment.rb +0 -0
  472. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project_with_overrides/ruby/app/cubs/services/play.rb +0 -0
  473. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project_with_overrides/ruby/app/giants/services/play.rb +0 -0
  474. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/fixtures/valid_project_with_overrides/ruby/app/rockies/services/play.rb +0 -0
  475. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/git_stage_test.rs +0 -0
  476. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/invalid_project_structure_test.rs +0 -0
  477. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/missing_github_team_test.rs +0 -0
  478. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/multiple_directory_owners_test.rs +0 -0
  479. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/run_config_executable_override_test.rs +0 -0
  480. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/runner_api.rs +0 -0
  481. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/untracked_files_test.rs +0 -0
  482. data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/valid_project_test.rs +6 -6
  483. /data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/valid_project_with_overrides_test.rs +0 -0
  484. /data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tests/validate_files_test.rs +0 -0
  485. /data/ext/cargo-vendor/{codeowners-0.3.3 → codeowners-0.5.0}/tmp/.gitkeep +0 -0
  486. /data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/LICENSE-APACHE.md +0 -0
  487. /data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/LICENSE-MIT.md +0 -0
  488. /data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/LICENSE.md +0 -0
  489. /data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/src/fmt/override.rs +0 -0
  490. /data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/doc/hook__location_hook.snap +0 -0
  491. /data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/doc/report_display__doc.snap +0 -0
  492. /data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/doc/report_display_alt__doc.snap +0 -0
  493. /data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/test_debug__full__alt.snap +0 -0
  494. /data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/test_debug__full__charset_ascii.snap +0 -0
  495. /data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/test_debug__full__color_mode_color.snap +0 -0
  496. /data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/test_debug__full__color_mode_emphasis.snap +0 -0
  497. /data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/test_debug__full__hook.snap +0 -0
  498. /data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/test_debug__full__hook_context.snap +0 -0
  499. /data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/test_debug__full__hook_decr.snap +0 -0
  500. /data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/test_debug__full__hook_for_context.snap +0 -0
  501. /data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/test_debug__full__hook_incr.snap +0 -0
  502. /data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/test_debug__full__hook_multiple.snap +0 -0
  503. /data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/test_debug__full__hook_provider.snap +0 -0
  504. /data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/test_debug__full__multiline.snap +0 -0
  505. /data/ext/cargo-vendor/{error-stack-0.5.0 → error-stack-0.8.0}/tests/snapshots/test_debug__full__norm.snap +0 -0
@@ -1,2366 +0,0 @@
1
- // This file is automatically generated, DO NOT EDIT
2
- //
3
- // To regenerate this file run the `crates/witx-bindgen` command
4
-
5
- use core::fmt;
6
- use core::mem::MaybeUninit;
7
- pub type Size = usize;
8
- pub type Filesize = u64;
9
- pub type Timestamp = u64;
10
- #[repr(transparent)]
11
- #[derive(Copy, Clone, Hash, Eq, PartialEq, Ord, PartialOrd)]
12
- pub struct Clockid(u32);
13
- /// The clock measuring real time. Time value zero corresponds with
14
- /// 1970-01-01T00:00:00Z.
15
- pub const CLOCKID_REALTIME: Clockid = Clockid(0);
16
- /// The store-wide monotonic clock, which is defined as a clock measuring
17
- /// real time, whose value cannot be adjusted and which cannot have negative
18
- /// clock jumps. The epoch of this clock is undefined. The absolute time
19
- /// value of this clock therefore has no meaning.
20
- pub const CLOCKID_MONOTONIC: Clockid = Clockid(1);
21
- /// The CPU-time clock associated with the current process.
22
- pub const CLOCKID_PROCESS_CPUTIME_ID: Clockid = Clockid(2);
23
- /// The CPU-time clock associated with the current thread.
24
- pub const CLOCKID_THREAD_CPUTIME_ID: Clockid = Clockid(3);
25
- impl Clockid {
26
- pub const fn raw(&self) -> u32 {
27
- self.0
28
- }
29
-
30
- pub fn name(&self) -> &'static str {
31
- match self.0 {
32
- 0 => "REALTIME",
33
- 1 => "MONOTONIC",
34
- 2 => "PROCESS_CPUTIME_ID",
35
- 3 => "THREAD_CPUTIME_ID",
36
- _ => unsafe { core::hint::unreachable_unchecked() },
37
- }
38
- }
39
- pub fn message(&self) -> &'static str {
40
- match self.0 {
41
- 0 => {
42
- "The clock measuring real time. Time value zero corresponds with
43
- 1970-01-01T00:00:00Z."
44
- }
45
- 1 => {
46
- "The store-wide monotonic clock, which is defined as a clock measuring
47
- real time, whose value cannot be adjusted and which cannot have negative
48
- clock jumps. The epoch of this clock is undefined. The absolute time
49
- value of this clock therefore has no meaning."
50
- }
51
- 2 => "The CPU-time clock associated with the current process.",
52
- 3 => "The CPU-time clock associated with the current thread.",
53
- _ => unsafe { core::hint::unreachable_unchecked() },
54
- }
55
- }
56
- }
57
- impl fmt::Debug for Clockid {
58
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
59
- f.debug_struct("Clockid")
60
- .field("code", &self.0)
61
- .field("name", &self.name())
62
- .field("message", &self.message())
63
- .finish()
64
- }
65
- }
66
-
67
- #[repr(transparent)]
68
- #[derive(Copy, Clone, Hash, Eq, PartialEq, Ord, PartialOrd)]
69
- pub struct Errno(u16);
70
- /// No error occurred. System call completed successfully.
71
- pub const ERRNO_SUCCESS: Errno = Errno(0);
72
- /// Argument list too long.
73
- pub const ERRNO_2BIG: Errno = Errno(1);
74
- /// Permission denied.
75
- pub const ERRNO_ACCES: Errno = Errno(2);
76
- /// Address in use.
77
- pub const ERRNO_ADDRINUSE: Errno = Errno(3);
78
- /// Address not available.
79
- pub const ERRNO_ADDRNOTAVAIL: Errno = Errno(4);
80
- /// Address family not supported.
81
- pub const ERRNO_AFNOSUPPORT: Errno = Errno(5);
82
- /// Resource unavailable, or operation would block.
83
- pub const ERRNO_AGAIN: Errno = Errno(6);
84
- /// Connection already in progress.
85
- pub const ERRNO_ALREADY: Errno = Errno(7);
86
- /// Bad file descriptor.
87
- pub const ERRNO_BADF: Errno = Errno(8);
88
- /// Bad message.
89
- pub const ERRNO_BADMSG: Errno = Errno(9);
90
- /// Device or resource busy.
91
- pub const ERRNO_BUSY: Errno = Errno(10);
92
- /// Operation canceled.
93
- pub const ERRNO_CANCELED: Errno = Errno(11);
94
- /// No child processes.
95
- pub const ERRNO_CHILD: Errno = Errno(12);
96
- /// Connection aborted.
97
- pub const ERRNO_CONNABORTED: Errno = Errno(13);
98
- /// Connection refused.
99
- pub const ERRNO_CONNREFUSED: Errno = Errno(14);
100
- /// Connection reset.
101
- pub const ERRNO_CONNRESET: Errno = Errno(15);
102
- /// Resource deadlock would occur.
103
- pub const ERRNO_DEADLK: Errno = Errno(16);
104
- /// Destination address required.
105
- pub const ERRNO_DESTADDRREQ: Errno = Errno(17);
106
- /// Mathematics argument out of domain of function.
107
- pub const ERRNO_DOM: Errno = Errno(18);
108
- /// Reserved.
109
- pub const ERRNO_DQUOT: Errno = Errno(19);
110
- /// File exists.
111
- pub const ERRNO_EXIST: Errno = Errno(20);
112
- /// Bad address.
113
- pub const ERRNO_FAULT: Errno = Errno(21);
114
- /// File too large.
115
- pub const ERRNO_FBIG: Errno = Errno(22);
116
- /// Host is unreachable.
117
- pub const ERRNO_HOSTUNREACH: Errno = Errno(23);
118
- /// Identifier removed.
119
- pub const ERRNO_IDRM: Errno = Errno(24);
120
- /// Illegal byte sequence.
121
- pub const ERRNO_ILSEQ: Errno = Errno(25);
122
- /// Operation in progress.
123
- pub const ERRNO_INPROGRESS: Errno = Errno(26);
124
- /// Interrupted function.
125
- pub const ERRNO_INTR: Errno = Errno(27);
126
- /// Invalid argument.
127
- pub const ERRNO_INVAL: Errno = Errno(28);
128
- /// I/O error.
129
- pub const ERRNO_IO: Errno = Errno(29);
130
- /// Socket is connected.
131
- pub const ERRNO_ISCONN: Errno = Errno(30);
132
- /// Is a directory.
133
- pub const ERRNO_ISDIR: Errno = Errno(31);
134
- /// Too many levels of symbolic links.
135
- pub const ERRNO_LOOP: Errno = Errno(32);
136
- /// File descriptor value too large.
137
- pub const ERRNO_MFILE: Errno = Errno(33);
138
- /// Too many links.
139
- pub const ERRNO_MLINK: Errno = Errno(34);
140
- /// Message too large.
141
- pub const ERRNO_MSGSIZE: Errno = Errno(35);
142
- /// Reserved.
143
- pub const ERRNO_MULTIHOP: Errno = Errno(36);
144
- /// Filename too long.
145
- pub const ERRNO_NAMETOOLONG: Errno = Errno(37);
146
- /// Network is down.
147
- pub const ERRNO_NETDOWN: Errno = Errno(38);
148
- /// Connection aborted by network.
149
- pub const ERRNO_NETRESET: Errno = Errno(39);
150
- /// Network unreachable.
151
- pub const ERRNO_NETUNREACH: Errno = Errno(40);
152
- /// Too many files open in system.
153
- pub const ERRNO_NFILE: Errno = Errno(41);
154
- /// No buffer space available.
155
- pub const ERRNO_NOBUFS: Errno = Errno(42);
156
- /// No such device.
157
- pub const ERRNO_NODEV: Errno = Errno(43);
158
- /// No such file or directory.
159
- pub const ERRNO_NOENT: Errno = Errno(44);
160
- /// Executable file format error.
161
- pub const ERRNO_NOEXEC: Errno = Errno(45);
162
- /// No locks available.
163
- pub const ERRNO_NOLCK: Errno = Errno(46);
164
- /// Reserved.
165
- pub const ERRNO_NOLINK: Errno = Errno(47);
166
- /// Not enough space.
167
- pub const ERRNO_NOMEM: Errno = Errno(48);
168
- /// No message of the desired type.
169
- pub const ERRNO_NOMSG: Errno = Errno(49);
170
- /// Protocol not available.
171
- pub const ERRNO_NOPROTOOPT: Errno = Errno(50);
172
- /// No space left on device.
173
- pub const ERRNO_NOSPC: Errno = Errno(51);
174
- /// Function not supported.
175
- pub const ERRNO_NOSYS: Errno = Errno(52);
176
- /// The socket is not connected.
177
- pub const ERRNO_NOTCONN: Errno = Errno(53);
178
- /// Not a directory or a symbolic link to a directory.
179
- pub const ERRNO_NOTDIR: Errno = Errno(54);
180
- /// Directory not empty.
181
- pub const ERRNO_NOTEMPTY: Errno = Errno(55);
182
- /// State not recoverable.
183
- pub const ERRNO_NOTRECOVERABLE: Errno = Errno(56);
184
- /// Not a socket.
185
- pub const ERRNO_NOTSOCK: Errno = Errno(57);
186
- /// Not supported, or operation not supported on socket.
187
- pub const ERRNO_NOTSUP: Errno = Errno(58);
188
- /// Inappropriate I/O control operation.
189
- pub const ERRNO_NOTTY: Errno = Errno(59);
190
- /// No such device or address.
191
- pub const ERRNO_NXIO: Errno = Errno(60);
192
- /// Value too large to be stored in data type.
193
- pub const ERRNO_OVERFLOW: Errno = Errno(61);
194
- /// Previous owner died.
195
- pub const ERRNO_OWNERDEAD: Errno = Errno(62);
196
- /// Operation not permitted.
197
- pub const ERRNO_PERM: Errno = Errno(63);
198
- /// Broken pipe.
199
- pub const ERRNO_PIPE: Errno = Errno(64);
200
- /// Protocol error.
201
- pub const ERRNO_PROTO: Errno = Errno(65);
202
- /// Protocol not supported.
203
- pub const ERRNO_PROTONOSUPPORT: Errno = Errno(66);
204
- /// Protocol wrong type for socket.
205
- pub const ERRNO_PROTOTYPE: Errno = Errno(67);
206
- /// Result too large.
207
- pub const ERRNO_RANGE: Errno = Errno(68);
208
- /// Read-only file system.
209
- pub const ERRNO_ROFS: Errno = Errno(69);
210
- /// Invalid seek.
211
- pub const ERRNO_SPIPE: Errno = Errno(70);
212
- /// No such process.
213
- pub const ERRNO_SRCH: Errno = Errno(71);
214
- /// Reserved.
215
- pub const ERRNO_STALE: Errno = Errno(72);
216
- /// Connection timed out.
217
- pub const ERRNO_TIMEDOUT: Errno = Errno(73);
218
- /// Text file busy.
219
- pub const ERRNO_TXTBSY: Errno = Errno(74);
220
- /// Cross-device link.
221
- pub const ERRNO_XDEV: Errno = Errno(75);
222
- /// Extension: Capabilities insufficient.
223
- pub const ERRNO_NOTCAPABLE: Errno = Errno(76);
224
- impl Errno {
225
- pub const fn raw(&self) -> u16 {
226
- self.0
227
- }
228
-
229
- pub fn name(&self) -> &'static str {
230
- match self.0 {
231
- 0 => "SUCCESS",
232
- 1 => "2BIG",
233
- 2 => "ACCES",
234
- 3 => "ADDRINUSE",
235
- 4 => "ADDRNOTAVAIL",
236
- 5 => "AFNOSUPPORT",
237
- 6 => "AGAIN",
238
- 7 => "ALREADY",
239
- 8 => "BADF",
240
- 9 => "BADMSG",
241
- 10 => "BUSY",
242
- 11 => "CANCELED",
243
- 12 => "CHILD",
244
- 13 => "CONNABORTED",
245
- 14 => "CONNREFUSED",
246
- 15 => "CONNRESET",
247
- 16 => "DEADLK",
248
- 17 => "DESTADDRREQ",
249
- 18 => "DOM",
250
- 19 => "DQUOT",
251
- 20 => "EXIST",
252
- 21 => "FAULT",
253
- 22 => "FBIG",
254
- 23 => "HOSTUNREACH",
255
- 24 => "IDRM",
256
- 25 => "ILSEQ",
257
- 26 => "INPROGRESS",
258
- 27 => "INTR",
259
- 28 => "INVAL",
260
- 29 => "IO",
261
- 30 => "ISCONN",
262
- 31 => "ISDIR",
263
- 32 => "LOOP",
264
- 33 => "MFILE",
265
- 34 => "MLINK",
266
- 35 => "MSGSIZE",
267
- 36 => "MULTIHOP",
268
- 37 => "NAMETOOLONG",
269
- 38 => "NETDOWN",
270
- 39 => "NETRESET",
271
- 40 => "NETUNREACH",
272
- 41 => "NFILE",
273
- 42 => "NOBUFS",
274
- 43 => "NODEV",
275
- 44 => "NOENT",
276
- 45 => "NOEXEC",
277
- 46 => "NOLCK",
278
- 47 => "NOLINK",
279
- 48 => "NOMEM",
280
- 49 => "NOMSG",
281
- 50 => "NOPROTOOPT",
282
- 51 => "NOSPC",
283
- 52 => "NOSYS",
284
- 53 => "NOTCONN",
285
- 54 => "NOTDIR",
286
- 55 => "NOTEMPTY",
287
- 56 => "NOTRECOVERABLE",
288
- 57 => "NOTSOCK",
289
- 58 => "NOTSUP",
290
- 59 => "NOTTY",
291
- 60 => "NXIO",
292
- 61 => "OVERFLOW",
293
- 62 => "OWNERDEAD",
294
- 63 => "PERM",
295
- 64 => "PIPE",
296
- 65 => "PROTO",
297
- 66 => "PROTONOSUPPORT",
298
- 67 => "PROTOTYPE",
299
- 68 => "RANGE",
300
- 69 => "ROFS",
301
- 70 => "SPIPE",
302
- 71 => "SRCH",
303
- 72 => "STALE",
304
- 73 => "TIMEDOUT",
305
- 74 => "TXTBSY",
306
- 75 => "XDEV",
307
- 76 => "NOTCAPABLE",
308
- _ => unsafe { core::hint::unreachable_unchecked() },
309
- }
310
- }
311
- pub fn message(&self) -> &'static str {
312
- match self.0 {
313
- 0 => "No error occurred. System call completed successfully.",
314
- 1 => "Argument list too long.",
315
- 2 => "Permission denied.",
316
- 3 => "Address in use.",
317
- 4 => "Address not available.",
318
- 5 => "Address family not supported.",
319
- 6 => "Resource unavailable, or operation would block.",
320
- 7 => "Connection already in progress.",
321
- 8 => "Bad file descriptor.",
322
- 9 => "Bad message.",
323
- 10 => "Device or resource busy.",
324
- 11 => "Operation canceled.",
325
- 12 => "No child processes.",
326
- 13 => "Connection aborted.",
327
- 14 => "Connection refused.",
328
- 15 => "Connection reset.",
329
- 16 => "Resource deadlock would occur.",
330
- 17 => "Destination address required.",
331
- 18 => "Mathematics argument out of domain of function.",
332
- 19 => "Reserved.",
333
- 20 => "File exists.",
334
- 21 => "Bad address.",
335
- 22 => "File too large.",
336
- 23 => "Host is unreachable.",
337
- 24 => "Identifier removed.",
338
- 25 => "Illegal byte sequence.",
339
- 26 => "Operation in progress.",
340
- 27 => "Interrupted function.",
341
- 28 => "Invalid argument.",
342
- 29 => "I/O error.",
343
- 30 => "Socket is connected.",
344
- 31 => "Is a directory.",
345
- 32 => "Too many levels of symbolic links.",
346
- 33 => "File descriptor value too large.",
347
- 34 => "Too many links.",
348
- 35 => "Message too large.",
349
- 36 => "Reserved.",
350
- 37 => "Filename too long.",
351
- 38 => "Network is down.",
352
- 39 => "Connection aborted by network.",
353
- 40 => "Network unreachable.",
354
- 41 => "Too many files open in system.",
355
- 42 => "No buffer space available.",
356
- 43 => "No such device.",
357
- 44 => "No such file or directory.",
358
- 45 => "Executable file format error.",
359
- 46 => "No locks available.",
360
- 47 => "Reserved.",
361
- 48 => "Not enough space.",
362
- 49 => "No message of the desired type.",
363
- 50 => "Protocol not available.",
364
- 51 => "No space left on device.",
365
- 52 => "Function not supported.",
366
- 53 => "The socket is not connected.",
367
- 54 => "Not a directory or a symbolic link to a directory.",
368
- 55 => "Directory not empty.",
369
- 56 => "State not recoverable.",
370
- 57 => "Not a socket.",
371
- 58 => "Not supported, or operation not supported on socket.",
372
- 59 => "Inappropriate I/O control operation.",
373
- 60 => "No such device or address.",
374
- 61 => "Value too large to be stored in data type.",
375
- 62 => "Previous owner died.",
376
- 63 => "Operation not permitted.",
377
- 64 => "Broken pipe.",
378
- 65 => "Protocol error.",
379
- 66 => "Protocol not supported.",
380
- 67 => "Protocol wrong type for socket.",
381
- 68 => "Result too large.",
382
- 69 => "Read-only file system.",
383
- 70 => "Invalid seek.",
384
- 71 => "No such process.",
385
- 72 => "Reserved.",
386
- 73 => "Connection timed out.",
387
- 74 => "Text file busy.",
388
- 75 => "Cross-device link.",
389
- 76 => "Extension: Capabilities insufficient.",
390
- _ => unsafe { core::hint::unreachable_unchecked() },
391
- }
392
- }
393
- }
394
- impl fmt::Debug for Errno {
395
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
396
- f.debug_struct("Errno")
397
- .field("code", &self.0)
398
- .field("name", &self.name())
399
- .field("message", &self.message())
400
- .finish()
401
- }
402
- }
403
- impl fmt::Display for Errno {
404
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
405
- write!(f, "{} (error {})", self.name(), self.0)
406
- }
407
- }
408
-
409
- #[cfg(feature = "std")]
410
- extern crate std;
411
- #[cfg(feature = "std")]
412
- impl std::error::Error for Errno {}
413
-
414
- pub type Rights = u64;
415
- /// The right to invoke `fd_datasync`.
416
- /// If `path_open` is set, includes the right to invoke
417
- /// `path_open` with `fdflags::dsync`.
418
- pub const RIGHTS_FD_DATASYNC: Rights = 1 << 0;
419
- /// The right to invoke `fd_read` and `sock_recv`.
420
- /// If `rights::fd_seek` is set, includes the right to invoke `fd_pread`.
421
- pub const RIGHTS_FD_READ: Rights = 1 << 1;
422
- /// The right to invoke `fd_seek`. This flag implies `rights::fd_tell`.
423
- pub const RIGHTS_FD_SEEK: Rights = 1 << 2;
424
- /// The right to invoke `fd_fdstat_set_flags`.
425
- pub const RIGHTS_FD_FDSTAT_SET_FLAGS: Rights = 1 << 3;
426
- /// The right to invoke `fd_sync`.
427
- /// If `path_open` is set, includes the right to invoke
428
- /// `path_open` with `fdflags::rsync` and `fdflags::dsync`.
429
- pub const RIGHTS_FD_SYNC: Rights = 1 << 4;
430
- /// The right to invoke `fd_seek` in such a way that the file offset
431
- /// remains unaltered (i.e., `whence::cur` with offset zero), or to
432
- /// invoke `fd_tell`.
433
- pub const RIGHTS_FD_TELL: Rights = 1 << 5;
434
- /// The right to invoke `fd_write` and `sock_send`.
435
- /// If `rights::fd_seek` is set, includes the right to invoke `fd_pwrite`.
436
- pub const RIGHTS_FD_WRITE: Rights = 1 << 6;
437
- /// The right to invoke `fd_advise`.
438
- pub const RIGHTS_FD_ADVISE: Rights = 1 << 7;
439
- /// The right to invoke `fd_allocate`.
440
- pub const RIGHTS_FD_ALLOCATE: Rights = 1 << 8;
441
- /// The right to invoke `path_create_directory`.
442
- pub const RIGHTS_PATH_CREATE_DIRECTORY: Rights = 1 << 9;
443
- /// If `path_open` is set, the right to invoke `path_open` with `oflags::creat`.
444
- pub const RIGHTS_PATH_CREATE_FILE: Rights = 1 << 10;
445
- /// The right to invoke `path_link` with the file descriptor as the
446
- /// source directory.
447
- pub const RIGHTS_PATH_LINK_SOURCE: Rights = 1 << 11;
448
- /// The right to invoke `path_link` with the file descriptor as the
449
- /// target directory.
450
- pub const RIGHTS_PATH_LINK_TARGET: Rights = 1 << 12;
451
- /// The right to invoke `path_open`.
452
- pub const RIGHTS_PATH_OPEN: Rights = 1 << 13;
453
- /// The right to invoke `fd_readdir`.
454
- pub const RIGHTS_FD_READDIR: Rights = 1 << 14;
455
- /// The right to invoke `path_readlink`.
456
- pub const RIGHTS_PATH_READLINK: Rights = 1 << 15;
457
- /// The right to invoke `path_rename` with the file descriptor as the source directory.
458
- pub const RIGHTS_PATH_RENAME_SOURCE: Rights = 1 << 16;
459
- /// The right to invoke `path_rename` with the file descriptor as the target directory.
460
- pub const RIGHTS_PATH_RENAME_TARGET: Rights = 1 << 17;
461
- /// The right to invoke `path_filestat_get`.
462
- pub const RIGHTS_PATH_FILESTAT_GET: Rights = 1 << 18;
463
- /// The right to change a file's size (there is no `path_filestat_set_size`).
464
- /// If `path_open` is set, includes the right to invoke `path_open` with `oflags::trunc`.
465
- pub const RIGHTS_PATH_FILESTAT_SET_SIZE: Rights = 1 << 19;
466
- /// The right to invoke `path_filestat_set_times`.
467
- pub const RIGHTS_PATH_FILESTAT_SET_TIMES: Rights = 1 << 20;
468
- /// The right to invoke `fd_filestat_get`.
469
- pub const RIGHTS_FD_FILESTAT_GET: Rights = 1 << 21;
470
- /// The right to invoke `fd_filestat_set_size`.
471
- pub const RIGHTS_FD_FILESTAT_SET_SIZE: Rights = 1 << 22;
472
- /// The right to invoke `fd_filestat_set_times`.
473
- pub const RIGHTS_FD_FILESTAT_SET_TIMES: Rights = 1 << 23;
474
- /// The right to invoke `path_symlink`.
475
- pub const RIGHTS_PATH_SYMLINK: Rights = 1 << 24;
476
- /// The right to invoke `path_remove_directory`.
477
- pub const RIGHTS_PATH_REMOVE_DIRECTORY: Rights = 1 << 25;
478
- /// The right to invoke `path_unlink_file`.
479
- pub const RIGHTS_PATH_UNLINK_FILE: Rights = 1 << 26;
480
- /// If `rights::fd_read` is set, includes the right to invoke `poll_oneoff` to subscribe to `eventtype::fd_read`.
481
- /// If `rights::fd_write` is set, includes the right to invoke `poll_oneoff` to subscribe to `eventtype::fd_write`.
482
- pub const RIGHTS_POLL_FD_READWRITE: Rights = 1 << 27;
483
- /// The right to invoke `sock_shutdown`.
484
- pub const RIGHTS_SOCK_SHUTDOWN: Rights = 1 << 28;
485
- /// The right to invoke `sock_accept`.
486
- pub const RIGHTS_SOCK_ACCEPT: Rights = 1 << 29;
487
-
488
- pub type Fd = u32;
489
- #[repr(C)]
490
- #[derive(Copy, Clone, Debug)]
491
- pub struct Iovec {
492
- /// The address of the buffer to be filled.
493
- pub buf: *mut u8,
494
- /// The length of the buffer to be filled.
495
- pub buf_len: Size,
496
- }
497
- #[repr(C)]
498
- #[derive(Copy, Clone, Debug)]
499
- pub struct Ciovec {
500
- /// The address of the buffer to be written.
501
- pub buf: *const u8,
502
- /// The length of the buffer to be written.
503
- pub buf_len: Size,
504
- }
505
- pub type IovecArray<'a> = &'a [Iovec];
506
- pub type CiovecArray<'a> = &'a [Ciovec];
507
- pub type Filedelta = i64;
508
- #[repr(transparent)]
509
- #[derive(Copy, Clone, Hash, Eq, PartialEq, Ord, PartialOrd)]
510
- pub struct Whence(u8);
511
- /// Seek relative to start-of-file.
512
- pub const WHENCE_SET: Whence = Whence(0);
513
- /// Seek relative to current position.
514
- pub const WHENCE_CUR: Whence = Whence(1);
515
- /// Seek relative to end-of-file.
516
- pub const WHENCE_END: Whence = Whence(2);
517
- impl Whence {
518
- pub const fn raw(&self) -> u8 {
519
- self.0
520
- }
521
-
522
- pub fn name(&self) -> &'static str {
523
- match self.0 {
524
- 0 => "SET",
525
- 1 => "CUR",
526
- 2 => "END",
527
- _ => unsafe { core::hint::unreachable_unchecked() },
528
- }
529
- }
530
- pub fn message(&self) -> &'static str {
531
- match self.0 {
532
- 0 => "Seek relative to start-of-file.",
533
- 1 => "Seek relative to current position.",
534
- 2 => "Seek relative to end-of-file.",
535
- _ => unsafe { core::hint::unreachable_unchecked() },
536
- }
537
- }
538
- }
539
- impl fmt::Debug for Whence {
540
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
541
- f.debug_struct("Whence")
542
- .field("code", &self.0)
543
- .field("name", &self.name())
544
- .field("message", &self.message())
545
- .finish()
546
- }
547
- }
548
-
549
- pub type Dircookie = u64;
550
- pub type Dirnamlen = u32;
551
- pub type Inode = u64;
552
- #[repr(transparent)]
553
- #[derive(Copy, Clone, Hash, Eq, PartialEq, Ord, PartialOrd)]
554
- pub struct Filetype(u8);
555
- /// The type of the file descriptor or file is unknown or is different from any of the other types specified.
556
- pub const FILETYPE_UNKNOWN: Filetype = Filetype(0);
557
- /// The file descriptor or file refers to a block device inode.
558
- pub const FILETYPE_BLOCK_DEVICE: Filetype = Filetype(1);
559
- /// The file descriptor or file refers to a character device inode.
560
- pub const FILETYPE_CHARACTER_DEVICE: Filetype = Filetype(2);
561
- /// The file descriptor or file refers to a directory inode.
562
- pub const FILETYPE_DIRECTORY: Filetype = Filetype(3);
563
- /// The file descriptor or file refers to a regular file inode.
564
- pub const FILETYPE_REGULAR_FILE: Filetype = Filetype(4);
565
- /// The file descriptor or file refers to a datagram socket.
566
- pub const FILETYPE_SOCKET_DGRAM: Filetype = Filetype(5);
567
- /// The file descriptor or file refers to a byte-stream socket.
568
- pub const FILETYPE_SOCKET_STREAM: Filetype = Filetype(6);
569
- /// The file refers to a symbolic link inode.
570
- pub const FILETYPE_SYMBOLIC_LINK: Filetype = Filetype(7);
571
- impl Filetype {
572
- pub const fn raw(&self) -> u8 {
573
- self.0
574
- }
575
-
576
- pub fn name(&self) -> &'static str {
577
- match self.0 {
578
- 0 => "UNKNOWN",
579
- 1 => "BLOCK_DEVICE",
580
- 2 => "CHARACTER_DEVICE",
581
- 3 => "DIRECTORY",
582
- 4 => "REGULAR_FILE",
583
- 5 => "SOCKET_DGRAM",
584
- 6 => "SOCKET_STREAM",
585
- 7 => "SYMBOLIC_LINK",
586
- _ => unsafe { core::hint::unreachable_unchecked() },
587
- }
588
- }
589
- pub fn message(&self) -> &'static str {
590
- match self.0 {0 => "The type of the file descriptor or file is unknown or is different from any of the other types specified.",1 => "The file descriptor or file refers to a block device inode.",2 => "The file descriptor or file refers to a character device inode.",3 => "The file descriptor or file refers to a directory inode.",4 => "The file descriptor or file refers to a regular file inode.",5 => "The file descriptor or file refers to a datagram socket.",6 => "The file descriptor or file refers to a byte-stream socket.",7 => "The file refers to a symbolic link inode.",_ => unsafe { core::hint::unreachable_unchecked() },}
591
- }
592
- }
593
- impl fmt::Debug for Filetype {
594
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
595
- f.debug_struct("Filetype")
596
- .field("code", &self.0)
597
- .field("name", &self.name())
598
- .field("message", &self.message())
599
- .finish()
600
- }
601
- }
602
-
603
- #[repr(C)]
604
- #[derive(Copy, Clone, Debug)]
605
- pub struct Dirent {
606
- /// The offset of the next directory entry stored in this directory.
607
- pub d_next: Dircookie,
608
- /// The serial number of the file referred to by this directory entry.
609
- pub d_ino: Inode,
610
- /// The length of the name of the directory entry.
611
- pub d_namlen: Dirnamlen,
612
- /// The type of the file referred to by this directory entry.
613
- pub d_type: Filetype,
614
- }
615
- #[repr(transparent)]
616
- #[derive(Copy, Clone, Hash, Eq, PartialEq, Ord, PartialOrd)]
617
- pub struct Advice(u8);
618
- /// The application has no advice to give on its behavior with respect to the specified data.
619
- pub const ADVICE_NORMAL: Advice = Advice(0);
620
- /// The application expects to access the specified data sequentially from lower offsets to higher offsets.
621
- pub const ADVICE_SEQUENTIAL: Advice = Advice(1);
622
- /// The application expects to access the specified data in a random order.
623
- pub const ADVICE_RANDOM: Advice = Advice(2);
624
- /// The application expects to access the specified data in the near future.
625
- pub const ADVICE_WILLNEED: Advice = Advice(3);
626
- /// The application expects that it will not access the specified data in the near future.
627
- pub const ADVICE_DONTNEED: Advice = Advice(4);
628
- /// The application expects to access the specified data once and then not reuse it thereafter.
629
- pub const ADVICE_NOREUSE: Advice = Advice(5);
630
- impl Advice {
631
- pub const fn raw(&self) -> u8 {
632
- self.0
633
- }
634
-
635
- pub fn name(&self) -> &'static str {
636
- match self.0 {
637
- 0 => "NORMAL",
638
- 1 => "SEQUENTIAL",
639
- 2 => "RANDOM",
640
- 3 => "WILLNEED",
641
- 4 => "DONTNEED",
642
- 5 => "NOREUSE",
643
- _ => unsafe { core::hint::unreachable_unchecked() },
644
- }
645
- }
646
- pub fn message(&self) -> &'static str {
647
- match self.0 {0 => "The application has no advice to give on its behavior with respect to the specified data.",1 => "The application expects to access the specified data sequentially from lower offsets to higher offsets.",2 => "The application expects to access the specified data in a random order.",3 => "The application expects to access the specified data in the near future.",4 => "The application expects that it will not access the specified data in the near future.",5 => "The application expects to access the specified data once and then not reuse it thereafter.",_ => unsafe { core::hint::unreachable_unchecked() },}
648
- }
649
- }
650
- impl fmt::Debug for Advice {
651
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
652
- f.debug_struct("Advice")
653
- .field("code", &self.0)
654
- .field("name", &self.name())
655
- .field("message", &self.message())
656
- .finish()
657
- }
658
- }
659
-
660
- pub type Fdflags = u16;
661
- /// Append mode: Data written to the file is always appended to the file's end.
662
- pub const FDFLAGS_APPEND: Fdflags = 1 << 0;
663
- /// Write according to synchronized I/O data integrity completion. Only the data stored in the file is synchronized.
664
- pub const FDFLAGS_DSYNC: Fdflags = 1 << 1;
665
- /// Non-blocking mode.
666
- pub const FDFLAGS_NONBLOCK: Fdflags = 1 << 2;
667
- /// Synchronized read I/O operations.
668
- pub const FDFLAGS_RSYNC: Fdflags = 1 << 3;
669
- /// Write according to synchronized I/O file integrity completion. In
670
- /// addition to synchronizing the data stored in the file, the implementation
671
- /// may also synchronously update the file's metadata.
672
- pub const FDFLAGS_SYNC: Fdflags = 1 << 4;
673
-
674
- #[repr(C)]
675
- #[derive(Copy, Clone, Debug)]
676
- pub struct Fdstat {
677
- /// File type.
678
- pub fs_filetype: Filetype,
679
- /// File descriptor flags.
680
- pub fs_flags: Fdflags,
681
- /// Rights that apply to this file descriptor.
682
- pub fs_rights_base: Rights,
683
- /// Maximum set of rights that may be installed on new file descriptors that
684
- /// are created through this file descriptor, e.g., through `path_open`.
685
- pub fs_rights_inheriting: Rights,
686
- }
687
- pub type Device = u64;
688
- pub type Fstflags = u16;
689
- /// Adjust the last data access timestamp to the value stored in `filestat::atim`.
690
- pub const FSTFLAGS_ATIM: Fstflags = 1 << 0;
691
- /// Adjust the last data access timestamp to the time of clock `clockid::realtime`.
692
- pub const FSTFLAGS_ATIM_NOW: Fstflags = 1 << 1;
693
- /// Adjust the last data modification timestamp to the value stored in `filestat::mtim`.
694
- pub const FSTFLAGS_MTIM: Fstflags = 1 << 2;
695
- /// Adjust the last data modification timestamp to the time of clock `clockid::realtime`.
696
- pub const FSTFLAGS_MTIM_NOW: Fstflags = 1 << 3;
697
-
698
- pub type Lookupflags = u32;
699
- /// As long as the resolved path corresponds to a symbolic link, it is expanded.
700
- pub const LOOKUPFLAGS_SYMLINK_FOLLOW: Lookupflags = 1 << 0;
701
-
702
- pub type Oflags = u16;
703
- /// Create file if it does not exist.
704
- pub const OFLAGS_CREAT: Oflags = 1 << 0;
705
- /// Fail if not a directory.
706
- pub const OFLAGS_DIRECTORY: Oflags = 1 << 1;
707
- /// Fail if file already exists.
708
- pub const OFLAGS_EXCL: Oflags = 1 << 2;
709
- /// Truncate file to size 0.
710
- pub const OFLAGS_TRUNC: Oflags = 1 << 3;
711
-
712
- pub type Linkcount = u64;
713
- #[repr(C)]
714
- #[derive(Copy, Clone, Debug)]
715
- pub struct Filestat {
716
- /// Device ID of device containing the file.
717
- pub dev: Device,
718
- /// File serial number.
719
- pub ino: Inode,
720
- /// File type.
721
- pub filetype: Filetype,
722
- /// Number of hard links to the file.
723
- pub nlink: Linkcount,
724
- /// For regular files, the file size in bytes. For symbolic links, the length in bytes of the pathname contained in the symbolic link.
725
- pub size: Filesize,
726
- /// Last data access timestamp.
727
- pub atim: Timestamp,
728
- /// Last data modification timestamp.
729
- pub mtim: Timestamp,
730
- /// Last file status change timestamp.
731
- pub ctim: Timestamp,
732
- }
733
- pub type Userdata = u64;
734
- #[repr(transparent)]
735
- #[derive(Copy, Clone, Hash, Eq, PartialEq, Ord, PartialOrd)]
736
- pub struct Eventtype(u8);
737
- /// The time value of clock `subscription_clock::id` has
738
- /// reached timestamp `subscription_clock::timeout`.
739
- pub const EVENTTYPE_CLOCK: Eventtype = Eventtype(0);
740
- /// File descriptor `subscription_fd_readwrite::file_descriptor` has data
741
- /// available for reading. This event always triggers for regular files.
742
- pub const EVENTTYPE_FD_READ: Eventtype = Eventtype(1);
743
- /// File descriptor `subscription_fd_readwrite::file_descriptor` has capacity
744
- /// available for writing. This event always triggers for regular files.
745
- pub const EVENTTYPE_FD_WRITE: Eventtype = Eventtype(2);
746
- impl Eventtype {
747
- pub const fn raw(&self) -> u8 {
748
- self.0
749
- }
750
-
751
- pub fn name(&self) -> &'static str {
752
- match self.0 {
753
- 0 => "CLOCK",
754
- 1 => "FD_READ",
755
- 2 => "FD_WRITE",
756
- _ => unsafe { core::hint::unreachable_unchecked() },
757
- }
758
- }
759
- pub fn message(&self) -> &'static str {
760
- match self.0 {
761
- 0 => {
762
- "The time value of clock `subscription_clock::id` has
763
- reached timestamp `subscription_clock::timeout`."
764
- }
765
- 1 => {
766
- "File descriptor `subscription_fd_readwrite::file_descriptor` has data
767
- available for reading. This event always triggers for regular files."
768
- }
769
- 2 => {
770
- "File descriptor `subscription_fd_readwrite::file_descriptor` has capacity
771
- available for writing. This event always triggers for regular files."
772
- }
773
- _ => unsafe { core::hint::unreachable_unchecked() },
774
- }
775
- }
776
- }
777
- impl fmt::Debug for Eventtype {
778
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
779
- f.debug_struct("Eventtype")
780
- .field("code", &self.0)
781
- .field("name", &self.name())
782
- .field("message", &self.message())
783
- .finish()
784
- }
785
- }
786
-
787
- pub type Eventrwflags = u16;
788
- /// The peer of this socket has closed or disconnected.
789
- pub const EVENTRWFLAGS_FD_READWRITE_HANGUP: Eventrwflags = 1 << 0;
790
-
791
- #[repr(C)]
792
- #[derive(Copy, Clone, Debug)]
793
- pub struct EventFdReadwrite {
794
- /// The number of bytes available for reading or writing.
795
- pub nbytes: Filesize,
796
- /// The state of the file descriptor.
797
- pub flags: Eventrwflags,
798
- }
799
- #[repr(C)]
800
- #[derive(Copy, Clone, Debug)]
801
- pub struct Event {
802
- /// User-provided value that got attached to `subscription::userdata`.
803
- pub userdata: Userdata,
804
- /// If non-zero, an error that occurred while processing the subscription request.
805
- pub error: Errno,
806
- /// The type of event that occured
807
- pub type_: Eventtype,
808
- /// The contents of the event, if it is an `eventtype::fd_read` or
809
- /// `eventtype::fd_write`. `eventtype::clock` events ignore this field.
810
- pub fd_readwrite: EventFdReadwrite,
811
- }
812
- pub type Subclockflags = u16;
813
- /// If set, treat the timestamp provided in
814
- /// `subscription_clock::timeout` as an absolute timestamp of clock
815
- /// `subscription_clock::id`. If clear, treat the timestamp
816
- /// provided in `subscription_clock::timeout` relative to the
817
- /// current time value of clock `subscription_clock::id`.
818
- pub const SUBCLOCKFLAGS_SUBSCRIPTION_CLOCK_ABSTIME: Subclockflags = 1 << 0;
819
-
820
- #[repr(C)]
821
- #[derive(Copy, Clone, Debug)]
822
- pub struct SubscriptionClock {
823
- /// The clock against which to compare the timestamp.
824
- pub id: Clockid,
825
- /// The absolute or relative timestamp.
826
- pub timeout: Timestamp,
827
- /// The amount of time that the implementation may wait additionally
828
- /// to coalesce with other events.
829
- pub precision: Timestamp,
830
- /// Flags specifying whether the timeout is absolute or relative
831
- pub flags: Subclockflags,
832
- }
833
- #[repr(C)]
834
- #[derive(Copy, Clone, Debug)]
835
- pub struct SubscriptionFdReadwrite {
836
- /// The file descriptor on which to wait for it to become ready for reading or writing.
837
- pub file_descriptor: Fd,
838
- }
839
- #[repr(C)]
840
- #[derive(Copy, Clone)]
841
- pub union SubscriptionUU {
842
- pub clock: SubscriptionClock,
843
- pub fd_read: SubscriptionFdReadwrite,
844
- pub fd_write: SubscriptionFdReadwrite,
845
- }
846
- #[repr(C)]
847
- #[derive(Copy, Clone)]
848
- pub struct SubscriptionU {
849
- pub tag: u8,
850
- pub u: SubscriptionUU,
851
- }
852
-
853
- #[repr(C)]
854
- #[derive(Copy, Clone)]
855
- pub struct Subscription {
856
- /// User-provided value that is attached to the subscription in the
857
- /// implementation and returned through `event::userdata`.
858
- pub userdata: Userdata,
859
- /// The type of the event to which to subscribe, and its contents
860
- pub u: SubscriptionU,
861
- }
862
- pub type Exitcode = u32;
863
- #[repr(transparent)]
864
- #[derive(Copy, Clone, Hash, Eq, PartialEq, Ord, PartialOrd)]
865
- pub struct Signal(u8);
866
- /// No signal. Note that POSIX has special semantics for `kill(pid, 0)`,
867
- /// so this value is reserved.
868
- pub const SIGNAL_NONE: Signal = Signal(0);
869
- /// Hangup.
870
- /// Action: Terminates the process.
871
- pub const SIGNAL_HUP: Signal = Signal(1);
872
- /// Terminate interrupt signal.
873
- /// Action: Terminates the process.
874
- pub const SIGNAL_INT: Signal = Signal(2);
875
- /// Terminal quit signal.
876
- /// Action: Terminates the process.
877
- pub const SIGNAL_QUIT: Signal = Signal(3);
878
- /// Illegal instruction.
879
- /// Action: Terminates the process.
880
- pub const SIGNAL_ILL: Signal = Signal(4);
881
- /// Trace/breakpoint trap.
882
- /// Action: Terminates the process.
883
- pub const SIGNAL_TRAP: Signal = Signal(5);
884
- /// Process abort signal.
885
- /// Action: Terminates the process.
886
- pub const SIGNAL_ABRT: Signal = Signal(6);
887
- /// Access to an undefined portion of a memory object.
888
- /// Action: Terminates the process.
889
- pub const SIGNAL_BUS: Signal = Signal(7);
890
- /// Erroneous arithmetic operation.
891
- /// Action: Terminates the process.
892
- pub const SIGNAL_FPE: Signal = Signal(8);
893
- /// Kill.
894
- /// Action: Terminates the process.
895
- pub const SIGNAL_KILL: Signal = Signal(9);
896
- /// User-defined signal 1.
897
- /// Action: Terminates the process.
898
- pub const SIGNAL_USR1: Signal = Signal(10);
899
- /// Invalid memory reference.
900
- /// Action: Terminates the process.
901
- pub const SIGNAL_SEGV: Signal = Signal(11);
902
- /// User-defined signal 2.
903
- /// Action: Terminates the process.
904
- pub const SIGNAL_USR2: Signal = Signal(12);
905
- /// Write on a pipe with no one to read it.
906
- /// Action: Ignored.
907
- pub const SIGNAL_PIPE: Signal = Signal(13);
908
- /// Alarm clock.
909
- /// Action: Terminates the process.
910
- pub const SIGNAL_ALRM: Signal = Signal(14);
911
- /// Termination signal.
912
- /// Action: Terminates the process.
913
- pub const SIGNAL_TERM: Signal = Signal(15);
914
- /// Child process terminated, stopped, or continued.
915
- /// Action: Ignored.
916
- pub const SIGNAL_CHLD: Signal = Signal(16);
917
- /// Continue executing, if stopped.
918
- /// Action: Continues executing, if stopped.
919
- pub const SIGNAL_CONT: Signal = Signal(17);
920
- /// Stop executing.
921
- /// Action: Stops executing.
922
- pub const SIGNAL_STOP: Signal = Signal(18);
923
- /// Terminal stop signal.
924
- /// Action: Stops executing.
925
- pub const SIGNAL_TSTP: Signal = Signal(19);
926
- /// Background process attempting read.
927
- /// Action: Stops executing.
928
- pub const SIGNAL_TTIN: Signal = Signal(20);
929
- /// Background process attempting write.
930
- /// Action: Stops executing.
931
- pub const SIGNAL_TTOU: Signal = Signal(21);
932
- /// High bandwidth data is available at a socket.
933
- /// Action: Ignored.
934
- pub const SIGNAL_URG: Signal = Signal(22);
935
- /// CPU time limit exceeded.
936
- /// Action: Terminates the process.
937
- pub const SIGNAL_XCPU: Signal = Signal(23);
938
- /// File size limit exceeded.
939
- /// Action: Terminates the process.
940
- pub const SIGNAL_XFSZ: Signal = Signal(24);
941
- /// Virtual timer expired.
942
- /// Action: Terminates the process.
943
- pub const SIGNAL_VTALRM: Signal = Signal(25);
944
- /// Profiling timer expired.
945
- /// Action: Terminates the process.
946
- pub const SIGNAL_PROF: Signal = Signal(26);
947
- /// Window changed.
948
- /// Action: Ignored.
949
- pub const SIGNAL_WINCH: Signal = Signal(27);
950
- /// I/O possible.
951
- /// Action: Terminates the process.
952
- pub const SIGNAL_POLL: Signal = Signal(28);
953
- /// Power failure.
954
- /// Action: Terminates the process.
955
- pub const SIGNAL_PWR: Signal = Signal(29);
956
- /// Bad system call.
957
- /// Action: Terminates the process.
958
- pub const SIGNAL_SYS: Signal = Signal(30);
959
- impl Signal {
960
- pub const fn raw(&self) -> u8 {
961
- self.0
962
- }
963
-
964
- pub fn name(&self) -> &'static str {
965
- match self.0 {
966
- 0 => "NONE",
967
- 1 => "HUP",
968
- 2 => "INT",
969
- 3 => "QUIT",
970
- 4 => "ILL",
971
- 5 => "TRAP",
972
- 6 => "ABRT",
973
- 7 => "BUS",
974
- 8 => "FPE",
975
- 9 => "KILL",
976
- 10 => "USR1",
977
- 11 => "SEGV",
978
- 12 => "USR2",
979
- 13 => "PIPE",
980
- 14 => "ALRM",
981
- 15 => "TERM",
982
- 16 => "CHLD",
983
- 17 => "CONT",
984
- 18 => "STOP",
985
- 19 => "TSTP",
986
- 20 => "TTIN",
987
- 21 => "TTOU",
988
- 22 => "URG",
989
- 23 => "XCPU",
990
- 24 => "XFSZ",
991
- 25 => "VTALRM",
992
- 26 => "PROF",
993
- 27 => "WINCH",
994
- 28 => "POLL",
995
- 29 => "PWR",
996
- 30 => "SYS",
997
- _ => unsafe { core::hint::unreachable_unchecked() },
998
- }
999
- }
1000
- pub fn message(&self) -> &'static str {
1001
- match self.0 {
1002
- 0 => {
1003
- "No signal. Note that POSIX has special semantics for `kill(pid, 0)`,
1004
- so this value is reserved."
1005
- }
1006
- 1 => {
1007
- "Hangup.
1008
- Action: Terminates the process."
1009
- }
1010
- 2 => {
1011
- "Terminate interrupt signal.
1012
- Action: Terminates the process."
1013
- }
1014
- 3 => {
1015
- "Terminal quit signal.
1016
- Action: Terminates the process."
1017
- }
1018
- 4 => {
1019
- "Illegal instruction.
1020
- Action: Terminates the process."
1021
- }
1022
- 5 => {
1023
- "Trace/breakpoint trap.
1024
- Action: Terminates the process."
1025
- }
1026
- 6 => {
1027
- "Process abort signal.
1028
- Action: Terminates the process."
1029
- }
1030
- 7 => {
1031
- "Access to an undefined portion of a memory object.
1032
- Action: Terminates the process."
1033
- }
1034
- 8 => {
1035
- "Erroneous arithmetic operation.
1036
- Action: Terminates the process."
1037
- }
1038
- 9 => {
1039
- "Kill.
1040
- Action: Terminates the process."
1041
- }
1042
- 10 => {
1043
- "User-defined signal 1.
1044
- Action: Terminates the process."
1045
- }
1046
- 11 => {
1047
- "Invalid memory reference.
1048
- Action: Terminates the process."
1049
- }
1050
- 12 => {
1051
- "User-defined signal 2.
1052
- Action: Terminates the process."
1053
- }
1054
- 13 => {
1055
- "Write on a pipe with no one to read it.
1056
- Action: Ignored."
1057
- }
1058
- 14 => {
1059
- "Alarm clock.
1060
- Action: Terminates the process."
1061
- }
1062
- 15 => {
1063
- "Termination signal.
1064
- Action: Terminates the process."
1065
- }
1066
- 16 => {
1067
- "Child process terminated, stopped, or continued.
1068
- Action: Ignored."
1069
- }
1070
- 17 => {
1071
- "Continue executing, if stopped.
1072
- Action: Continues executing, if stopped."
1073
- }
1074
- 18 => {
1075
- "Stop executing.
1076
- Action: Stops executing."
1077
- }
1078
- 19 => {
1079
- "Terminal stop signal.
1080
- Action: Stops executing."
1081
- }
1082
- 20 => {
1083
- "Background process attempting read.
1084
- Action: Stops executing."
1085
- }
1086
- 21 => {
1087
- "Background process attempting write.
1088
- Action: Stops executing."
1089
- }
1090
- 22 => {
1091
- "High bandwidth data is available at a socket.
1092
- Action: Ignored."
1093
- }
1094
- 23 => {
1095
- "CPU time limit exceeded.
1096
- Action: Terminates the process."
1097
- }
1098
- 24 => {
1099
- "File size limit exceeded.
1100
- Action: Terminates the process."
1101
- }
1102
- 25 => {
1103
- "Virtual timer expired.
1104
- Action: Terminates the process."
1105
- }
1106
- 26 => {
1107
- "Profiling timer expired.
1108
- Action: Terminates the process."
1109
- }
1110
- 27 => {
1111
- "Window changed.
1112
- Action: Ignored."
1113
- }
1114
- 28 => {
1115
- "I/O possible.
1116
- Action: Terminates the process."
1117
- }
1118
- 29 => {
1119
- "Power failure.
1120
- Action: Terminates the process."
1121
- }
1122
- 30 => {
1123
- "Bad system call.
1124
- Action: Terminates the process."
1125
- }
1126
- _ => unsafe { core::hint::unreachable_unchecked() },
1127
- }
1128
- }
1129
- }
1130
- impl fmt::Debug for Signal {
1131
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1132
- f.debug_struct("Signal")
1133
- .field("code", &self.0)
1134
- .field("name", &self.name())
1135
- .field("message", &self.message())
1136
- .finish()
1137
- }
1138
- }
1139
-
1140
- pub type Riflags = u16;
1141
- /// Returns the message without removing it from the socket's receive queue.
1142
- pub const RIFLAGS_RECV_PEEK: Riflags = 1 << 0;
1143
- /// On byte-stream sockets, block until the full amount of data can be returned.
1144
- pub const RIFLAGS_RECV_WAITALL: Riflags = 1 << 1;
1145
-
1146
- pub type Roflags = u16;
1147
- /// Returned by `sock_recv`: Message data has been truncated.
1148
- pub const ROFLAGS_RECV_DATA_TRUNCATED: Roflags = 1 << 0;
1149
-
1150
- pub type Siflags = u16;
1151
- pub type Sdflags = u8;
1152
- /// Disables further receive operations.
1153
- pub const SDFLAGS_RD: Sdflags = 1 << 0;
1154
- /// Disables further send operations.
1155
- pub const SDFLAGS_WR: Sdflags = 1 << 1;
1156
-
1157
- #[repr(transparent)]
1158
- #[derive(Copy, Clone, Hash, Eq, PartialEq, Ord, PartialOrd)]
1159
- pub struct Preopentype(u8);
1160
- /// A pre-opened directory.
1161
- pub const PREOPENTYPE_DIR: Preopentype = Preopentype(0);
1162
- impl Preopentype {
1163
- pub const fn raw(&self) -> u8 {
1164
- self.0
1165
- }
1166
-
1167
- pub fn name(&self) -> &'static str {
1168
- match self.0 {
1169
- 0 => "DIR",
1170
- _ => unsafe { core::hint::unreachable_unchecked() },
1171
- }
1172
- }
1173
- pub fn message(&self) -> &'static str {
1174
- match self.0 {
1175
- 0 => "A pre-opened directory.",
1176
- _ => unsafe { core::hint::unreachable_unchecked() },
1177
- }
1178
- }
1179
- }
1180
- impl fmt::Debug for Preopentype {
1181
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1182
- f.debug_struct("Preopentype")
1183
- .field("code", &self.0)
1184
- .field("name", &self.name())
1185
- .field("message", &self.message())
1186
- .finish()
1187
- }
1188
- }
1189
-
1190
- #[repr(C)]
1191
- #[derive(Copy, Clone, Debug)]
1192
- pub struct PrestatDir {
1193
- /// The length of the directory name for use with `fd_prestat_dir_name`.
1194
- pub pr_name_len: Size,
1195
- }
1196
- #[repr(C)]
1197
- #[derive(Copy, Clone)]
1198
- pub union PrestatU {
1199
- pub dir: PrestatDir,
1200
- }
1201
- #[repr(C)]
1202
- #[derive(Copy, Clone)]
1203
- pub struct Prestat {
1204
- pub tag: u8,
1205
- pub u: PrestatU,
1206
- }
1207
-
1208
- /// Read command-line argument data.
1209
- /// The size of the array should match that returned by `args_sizes_get`.
1210
- /// Each argument is expected to be `\0` terminated.
1211
- pub unsafe fn args_get(argv: *mut *mut u8, argv_buf: *mut u8) -> Result<(), Errno> {
1212
- let ret = wasi_snapshot_preview1::args_get(argv as i32, argv_buf as i32);
1213
- match ret {
1214
- 0 => Ok(()),
1215
- _ => Err(Errno(ret as u16)),
1216
- }
1217
- }
1218
-
1219
- /// Return command-line argument data sizes.
1220
- ///
1221
- /// ## Return
1222
- ///
1223
- /// Returns the number of arguments and the size of the argument string
1224
- /// data, or an error.
1225
- pub unsafe fn args_sizes_get() -> Result<(Size, Size), Errno> {
1226
- let mut rp0 = MaybeUninit::<Size>::uninit();
1227
- let mut rp1 = MaybeUninit::<Size>::uninit();
1228
- let ret =
1229
- wasi_snapshot_preview1::args_sizes_get(rp0.as_mut_ptr() as i32, rp1.as_mut_ptr() as i32);
1230
- match ret {
1231
- 0 => Ok((
1232
- core::ptr::read(rp0.as_mut_ptr() as i32 as *const Size),
1233
- core::ptr::read(rp1.as_mut_ptr() as i32 as *const Size),
1234
- )),
1235
- _ => Err(Errno(ret as u16)),
1236
- }
1237
- }
1238
-
1239
- /// Read environment variable data.
1240
- /// The sizes of the buffers should match that returned by `environ_sizes_get`.
1241
- /// Key/value pairs are expected to be joined with `=`s, and terminated with `\0`s.
1242
- pub unsafe fn environ_get(environ: *mut *mut u8, environ_buf: *mut u8) -> Result<(), Errno> {
1243
- let ret = wasi_snapshot_preview1::environ_get(environ as i32, environ_buf as i32);
1244
- match ret {
1245
- 0 => Ok(()),
1246
- _ => Err(Errno(ret as u16)),
1247
- }
1248
- }
1249
-
1250
- /// Return environment variable data sizes.
1251
- ///
1252
- /// ## Return
1253
- ///
1254
- /// Returns the number of environment variable arguments and the size of the
1255
- /// environment variable data.
1256
- pub unsafe fn environ_sizes_get() -> Result<(Size, Size), Errno> {
1257
- let mut rp0 = MaybeUninit::<Size>::uninit();
1258
- let mut rp1 = MaybeUninit::<Size>::uninit();
1259
- let ret =
1260
- wasi_snapshot_preview1::environ_sizes_get(rp0.as_mut_ptr() as i32, rp1.as_mut_ptr() as i32);
1261
- match ret {
1262
- 0 => Ok((
1263
- core::ptr::read(rp0.as_mut_ptr() as i32 as *const Size),
1264
- core::ptr::read(rp1.as_mut_ptr() as i32 as *const Size),
1265
- )),
1266
- _ => Err(Errno(ret as u16)),
1267
- }
1268
- }
1269
-
1270
- /// Return the resolution of a clock.
1271
- /// Implementations are required to provide a non-zero value for supported clocks. For unsupported clocks,
1272
- /// return `errno::inval`.
1273
- /// Note: This is similar to `clock_getres` in POSIX.
1274
- ///
1275
- /// ## Parameters
1276
- ///
1277
- /// * `id` - The clock for which to return the resolution.
1278
- ///
1279
- /// ## Return
1280
- ///
1281
- /// The resolution of the clock, or an error if one happened.
1282
- pub unsafe fn clock_res_get(id: Clockid) -> Result<Timestamp, Errno> {
1283
- let mut rp0 = MaybeUninit::<Timestamp>::uninit();
1284
- let ret = wasi_snapshot_preview1::clock_res_get(id.0 as i32, rp0.as_mut_ptr() as i32);
1285
- match ret {
1286
- 0 => Ok(core::ptr::read(rp0.as_mut_ptr() as i32 as *const Timestamp)),
1287
- _ => Err(Errno(ret as u16)),
1288
- }
1289
- }
1290
-
1291
- /// Return the time value of a clock.
1292
- /// Note: This is similar to `clock_gettime` in POSIX.
1293
- ///
1294
- /// ## Parameters
1295
- ///
1296
- /// * `id` - The clock for which to return the time.
1297
- /// * `precision` - The maximum lag (exclusive) that the returned time value may have, compared to its actual value.
1298
- ///
1299
- /// ## Return
1300
- ///
1301
- /// The time value of the clock.
1302
- pub unsafe fn clock_time_get(id: Clockid, precision: Timestamp) -> Result<Timestamp, Errno> {
1303
- let mut rp0 = MaybeUninit::<Timestamp>::uninit();
1304
- let ret = wasi_snapshot_preview1::clock_time_get(
1305
- id.0 as i32,
1306
- precision as i64,
1307
- rp0.as_mut_ptr() as i32,
1308
- );
1309
- match ret {
1310
- 0 => Ok(core::ptr::read(rp0.as_mut_ptr() as i32 as *const Timestamp)),
1311
- _ => Err(Errno(ret as u16)),
1312
- }
1313
- }
1314
-
1315
- /// Provide file advisory information on a file descriptor.
1316
- /// Note: This is similar to `posix_fadvise` in POSIX.
1317
- ///
1318
- /// ## Parameters
1319
- ///
1320
- /// * `offset` - The offset within the file to which the advisory applies.
1321
- /// * `len` - The length of the region to which the advisory applies.
1322
- /// * `advice` - The advice.
1323
- pub unsafe fn fd_advise(
1324
- fd: Fd,
1325
- offset: Filesize,
1326
- len: Filesize,
1327
- advice: Advice,
1328
- ) -> Result<(), Errno> {
1329
- let ret =
1330
- wasi_snapshot_preview1::fd_advise(fd as i32, offset as i64, len as i64, advice.0 as i32);
1331
- match ret {
1332
- 0 => Ok(()),
1333
- _ => Err(Errno(ret as u16)),
1334
- }
1335
- }
1336
-
1337
- /// Force the allocation of space in a file.
1338
- /// Note: This is similar to `posix_fallocate` in POSIX.
1339
- ///
1340
- /// ## Parameters
1341
- ///
1342
- /// * `offset` - The offset at which to start the allocation.
1343
- /// * `len` - The length of the area that is allocated.
1344
- pub unsafe fn fd_allocate(fd: Fd, offset: Filesize, len: Filesize) -> Result<(), Errno> {
1345
- let ret = wasi_snapshot_preview1::fd_allocate(fd as i32, offset as i64, len as i64);
1346
- match ret {
1347
- 0 => Ok(()),
1348
- _ => Err(Errno(ret as u16)),
1349
- }
1350
- }
1351
-
1352
- /// Close a file descriptor.
1353
- /// Note: This is similar to `close` in POSIX.
1354
- pub unsafe fn fd_close(fd: Fd) -> Result<(), Errno> {
1355
- let ret = wasi_snapshot_preview1::fd_close(fd as i32);
1356
- match ret {
1357
- 0 => Ok(()),
1358
- _ => Err(Errno(ret as u16)),
1359
- }
1360
- }
1361
-
1362
- /// Synchronize the data of a file to disk.
1363
- /// Note: This is similar to `fdatasync` in POSIX.
1364
- pub unsafe fn fd_datasync(fd: Fd) -> Result<(), Errno> {
1365
- let ret = wasi_snapshot_preview1::fd_datasync(fd as i32);
1366
- match ret {
1367
- 0 => Ok(()),
1368
- _ => Err(Errno(ret as u16)),
1369
- }
1370
- }
1371
-
1372
- /// Get the attributes of a file descriptor.
1373
- /// Note: This returns similar flags to `fsync(fd, F_GETFL)` in POSIX, as well as additional fields.
1374
- ///
1375
- /// ## Return
1376
- ///
1377
- /// The buffer where the file descriptor's attributes are stored.
1378
- pub unsafe fn fd_fdstat_get(fd: Fd) -> Result<Fdstat, Errno> {
1379
- let mut rp0 = MaybeUninit::<Fdstat>::uninit();
1380
- let ret = wasi_snapshot_preview1::fd_fdstat_get(fd as i32, rp0.as_mut_ptr() as i32);
1381
- match ret {
1382
- 0 => Ok(core::ptr::read(rp0.as_mut_ptr() as i32 as *const Fdstat)),
1383
- _ => Err(Errno(ret as u16)),
1384
- }
1385
- }
1386
-
1387
- /// Adjust the flags associated with a file descriptor.
1388
- /// Note: This is similar to `fcntl(fd, F_SETFL, flags)` in POSIX.
1389
- ///
1390
- /// ## Parameters
1391
- ///
1392
- /// * `flags` - The desired values of the file descriptor flags.
1393
- pub unsafe fn fd_fdstat_set_flags(fd: Fd, flags: Fdflags) -> Result<(), Errno> {
1394
- let ret = wasi_snapshot_preview1::fd_fdstat_set_flags(fd as i32, flags as i32);
1395
- match ret {
1396
- 0 => Ok(()),
1397
- _ => Err(Errno(ret as u16)),
1398
- }
1399
- }
1400
-
1401
- /// Adjust the rights associated with a file descriptor.
1402
- /// This can only be used to remove rights, and returns `errno::notcapable` if called in a way that would attempt to add rights
1403
- ///
1404
- /// ## Parameters
1405
- ///
1406
- /// * `fs_rights_base` - The desired rights of the file descriptor.
1407
- pub unsafe fn fd_fdstat_set_rights(
1408
- fd: Fd,
1409
- fs_rights_base: Rights,
1410
- fs_rights_inheriting: Rights,
1411
- ) -> Result<(), Errno> {
1412
- let ret = wasi_snapshot_preview1::fd_fdstat_set_rights(
1413
- fd as i32,
1414
- fs_rights_base as i64,
1415
- fs_rights_inheriting as i64,
1416
- );
1417
- match ret {
1418
- 0 => Ok(()),
1419
- _ => Err(Errno(ret as u16)),
1420
- }
1421
- }
1422
-
1423
- /// Return the attributes of an open file.
1424
- ///
1425
- /// ## Return
1426
- ///
1427
- /// The buffer where the file's attributes are stored.
1428
- pub unsafe fn fd_filestat_get(fd: Fd) -> Result<Filestat, Errno> {
1429
- let mut rp0 = MaybeUninit::<Filestat>::uninit();
1430
- let ret = wasi_snapshot_preview1::fd_filestat_get(fd as i32, rp0.as_mut_ptr() as i32);
1431
- match ret {
1432
- 0 => Ok(core::ptr::read(rp0.as_mut_ptr() as i32 as *const Filestat)),
1433
- _ => Err(Errno(ret as u16)),
1434
- }
1435
- }
1436
-
1437
- /// Adjust the size of an open file. If this increases the file's size, the extra bytes are filled with zeros.
1438
- /// Note: This is similar to `ftruncate` in POSIX.
1439
- ///
1440
- /// ## Parameters
1441
- ///
1442
- /// * `size` - The desired file size.
1443
- pub unsafe fn fd_filestat_set_size(fd: Fd, size: Filesize) -> Result<(), Errno> {
1444
- let ret = wasi_snapshot_preview1::fd_filestat_set_size(fd as i32, size as i64);
1445
- match ret {
1446
- 0 => Ok(()),
1447
- _ => Err(Errno(ret as u16)),
1448
- }
1449
- }
1450
-
1451
- /// Adjust the timestamps of an open file or directory.
1452
- /// Note: This is similar to `futimens` in POSIX.
1453
- ///
1454
- /// ## Parameters
1455
- ///
1456
- /// * `atim` - The desired values of the data access timestamp.
1457
- /// * `mtim` - The desired values of the data modification timestamp.
1458
- /// * `fst_flags` - A bitmask indicating which timestamps to adjust.
1459
- pub unsafe fn fd_filestat_set_times(
1460
- fd: Fd,
1461
- atim: Timestamp,
1462
- mtim: Timestamp,
1463
- fst_flags: Fstflags,
1464
- ) -> Result<(), Errno> {
1465
- let ret = wasi_snapshot_preview1::fd_filestat_set_times(
1466
- fd as i32,
1467
- atim as i64,
1468
- mtim as i64,
1469
- fst_flags as i32,
1470
- );
1471
- match ret {
1472
- 0 => Ok(()),
1473
- _ => Err(Errno(ret as u16)),
1474
- }
1475
- }
1476
-
1477
- /// Read from a file descriptor, without using and updating the file descriptor's offset.
1478
- /// Note: This is similar to `preadv` in POSIX.
1479
- ///
1480
- /// ## Parameters
1481
- ///
1482
- /// * `iovs` - List of scatter/gather vectors in which to store data.
1483
- /// * `offset` - The offset within the file at which to read.
1484
- ///
1485
- /// ## Return
1486
- ///
1487
- /// The number of bytes read.
1488
- pub unsafe fn fd_pread(fd: Fd, iovs: IovecArray<'_>, offset: Filesize) -> Result<Size, Errno> {
1489
- let mut rp0 = MaybeUninit::<Size>::uninit();
1490
- let ret = wasi_snapshot_preview1::fd_pread(
1491
- fd as i32,
1492
- iovs.as_ptr() as i32,
1493
- iovs.len() as i32,
1494
- offset as i64,
1495
- rp0.as_mut_ptr() as i32,
1496
- );
1497
- match ret {
1498
- 0 => Ok(core::ptr::read(rp0.as_mut_ptr() as i32 as *const Size)),
1499
- _ => Err(Errno(ret as u16)),
1500
- }
1501
- }
1502
-
1503
- /// Return a description of the given preopened file descriptor.
1504
- ///
1505
- /// ## Return
1506
- ///
1507
- /// The buffer where the description is stored.
1508
- pub unsafe fn fd_prestat_get(fd: Fd) -> Result<Prestat, Errno> {
1509
- let mut rp0 = MaybeUninit::<Prestat>::uninit();
1510
- let ret = wasi_snapshot_preview1::fd_prestat_get(fd as i32, rp0.as_mut_ptr() as i32);
1511
- match ret {
1512
- 0 => Ok(core::ptr::read(rp0.as_mut_ptr() as i32 as *const Prestat)),
1513
- _ => Err(Errno(ret as u16)),
1514
- }
1515
- }
1516
-
1517
- /// Return a description of the given preopened file descriptor.
1518
- ///
1519
- /// ## Parameters
1520
- ///
1521
- /// * `path` - A buffer into which to write the preopened directory name.
1522
- pub unsafe fn fd_prestat_dir_name(fd: Fd, path: *mut u8, path_len: Size) -> Result<(), Errno> {
1523
- let ret = wasi_snapshot_preview1::fd_prestat_dir_name(fd as i32, path as i32, path_len as i32);
1524
- match ret {
1525
- 0 => Ok(()),
1526
- _ => Err(Errno(ret as u16)),
1527
- }
1528
- }
1529
-
1530
- /// Write to a file descriptor, without using and updating the file descriptor's offset.
1531
- /// Note: This is similar to `pwritev` in POSIX.
1532
- ///
1533
- /// ## Parameters
1534
- ///
1535
- /// * `iovs` - List of scatter/gather vectors from which to retrieve data.
1536
- /// * `offset` - The offset within the file at which to write.
1537
- ///
1538
- /// ## Return
1539
- ///
1540
- /// The number of bytes written.
1541
- pub unsafe fn fd_pwrite(fd: Fd, iovs: CiovecArray<'_>, offset: Filesize) -> Result<Size, Errno> {
1542
- let mut rp0 = MaybeUninit::<Size>::uninit();
1543
- let ret = wasi_snapshot_preview1::fd_pwrite(
1544
- fd as i32,
1545
- iovs.as_ptr() as i32,
1546
- iovs.len() as i32,
1547
- offset as i64,
1548
- rp0.as_mut_ptr() as i32,
1549
- );
1550
- match ret {
1551
- 0 => Ok(core::ptr::read(rp0.as_mut_ptr() as i32 as *const Size)),
1552
- _ => Err(Errno(ret as u16)),
1553
- }
1554
- }
1555
-
1556
- /// Read from a file descriptor.
1557
- /// Note: This is similar to `readv` in POSIX.
1558
- ///
1559
- /// ## Parameters
1560
- ///
1561
- /// * `iovs` - List of scatter/gather vectors to which to store data.
1562
- ///
1563
- /// ## Return
1564
- ///
1565
- /// The number of bytes read.
1566
- pub unsafe fn fd_read(fd: Fd, iovs: IovecArray<'_>) -> Result<Size, Errno> {
1567
- let mut rp0 = MaybeUninit::<Size>::uninit();
1568
- let ret = wasi_snapshot_preview1::fd_read(
1569
- fd as i32,
1570
- iovs.as_ptr() as i32,
1571
- iovs.len() as i32,
1572
- rp0.as_mut_ptr() as i32,
1573
- );
1574
- match ret {
1575
- 0 => Ok(core::ptr::read(rp0.as_mut_ptr() as i32 as *const Size)),
1576
- _ => Err(Errno(ret as u16)),
1577
- }
1578
- }
1579
-
1580
- /// Read directory entries from a directory.
1581
- /// When successful, the contents of the output buffer consist of a sequence of
1582
- /// directory entries. Each directory entry consists of a `dirent` object,
1583
- /// followed by `dirent::d_namlen` bytes holding the name of the directory
1584
- /// entry.
1585
- /// This function fills the output buffer as much as possible, potentially
1586
- /// truncating the last directory entry. This allows the caller to grow its
1587
- /// read buffer size in case it's too small to fit a single large directory
1588
- /// entry, or skip the oversized directory entry.
1589
- ///
1590
- /// ## Parameters
1591
- ///
1592
- /// * `buf` - The buffer where directory entries are stored
1593
- /// * `cookie` - The location within the directory to start reading
1594
- ///
1595
- /// ## Return
1596
- ///
1597
- /// The number of bytes stored in the read buffer. If less than the size of the read buffer, the end of the directory has been reached.
1598
- pub unsafe fn fd_readdir(
1599
- fd: Fd,
1600
- buf: *mut u8,
1601
- buf_len: Size,
1602
- cookie: Dircookie,
1603
- ) -> Result<Size, Errno> {
1604
- let mut rp0 = MaybeUninit::<Size>::uninit();
1605
- let ret = wasi_snapshot_preview1::fd_readdir(
1606
- fd as i32,
1607
- buf as i32,
1608
- buf_len as i32,
1609
- cookie as i64,
1610
- rp0.as_mut_ptr() as i32,
1611
- );
1612
- match ret {
1613
- 0 => Ok(core::ptr::read(rp0.as_mut_ptr() as i32 as *const Size)),
1614
- _ => Err(Errno(ret as u16)),
1615
- }
1616
- }
1617
-
1618
- /// Atomically replace a file descriptor by renumbering another file descriptor.
1619
- /// Due to the strong focus on thread safety, this environment does not provide
1620
- /// a mechanism to duplicate or renumber a file descriptor to an arbitrary
1621
- /// number, like `dup2()`. This would be prone to race conditions, as an actual
1622
- /// file descriptor with the same number could be allocated by a different
1623
- /// thread at the same time.
1624
- /// This function provides a way to atomically renumber file descriptors, which
1625
- /// would disappear if `dup2()` were to be removed entirely.
1626
- ///
1627
- /// ## Parameters
1628
- ///
1629
- /// * `to` - The file descriptor to overwrite.
1630
- pub unsafe fn fd_renumber(fd: Fd, to: Fd) -> Result<(), Errno> {
1631
- let ret = wasi_snapshot_preview1::fd_renumber(fd as i32, to as i32);
1632
- match ret {
1633
- 0 => Ok(()),
1634
- _ => Err(Errno(ret as u16)),
1635
- }
1636
- }
1637
-
1638
- /// Move the offset of a file descriptor.
1639
- /// Note: This is similar to `lseek` in POSIX.
1640
- ///
1641
- /// ## Parameters
1642
- ///
1643
- /// * `offset` - The number of bytes to move.
1644
- /// * `whence` - The base from which the offset is relative.
1645
- ///
1646
- /// ## Return
1647
- ///
1648
- /// The new offset of the file descriptor, relative to the start of the file.
1649
- pub unsafe fn fd_seek(fd: Fd, offset: Filedelta, whence: Whence) -> Result<Filesize, Errno> {
1650
- let mut rp0 = MaybeUninit::<Filesize>::uninit();
1651
- let ret = wasi_snapshot_preview1::fd_seek(
1652
- fd as i32,
1653
- offset,
1654
- whence.0 as i32,
1655
- rp0.as_mut_ptr() as i32,
1656
- );
1657
- match ret {
1658
- 0 => Ok(core::ptr::read(rp0.as_mut_ptr() as i32 as *const Filesize)),
1659
- _ => Err(Errno(ret as u16)),
1660
- }
1661
- }
1662
-
1663
- /// Synchronize the data and metadata of a file to disk.
1664
- /// Note: This is similar to `fsync` in POSIX.
1665
- pub unsafe fn fd_sync(fd: Fd) -> Result<(), Errno> {
1666
- let ret = wasi_snapshot_preview1::fd_sync(fd as i32);
1667
- match ret {
1668
- 0 => Ok(()),
1669
- _ => Err(Errno(ret as u16)),
1670
- }
1671
- }
1672
-
1673
- /// Return the current offset of a file descriptor.
1674
- /// Note: This is similar to `lseek(fd, 0, SEEK_CUR)` in POSIX.
1675
- ///
1676
- /// ## Return
1677
- ///
1678
- /// The current offset of the file descriptor, relative to the start of the file.
1679
- pub unsafe fn fd_tell(fd: Fd) -> Result<Filesize, Errno> {
1680
- let mut rp0 = MaybeUninit::<Filesize>::uninit();
1681
- let ret = wasi_snapshot_preview1::fd_tell(fd as i32, rp0.as_mut_ptr() as i32);
1682
- match ret {
1683
- 0 => Ok(core::ptr::read(rp0.as_mut_ptr() as i32 as *const Filesize)),
1684
- _ => Err(Errno(ret as u16)),
1685
- }
1686
- }
1687
-
1688
- /// Write to a file descriptor.
1689
- /// Note: This is similar to `writev` in POSIX.
1690
- ///
1691
- /// ## Parameters
1692
- ///
1693
- /// * `iovs` - List of scatter/gather vectors from which to retrieve data.
1694
- pub unsafe fn fd_write(fd: Fd, iovs: CiovecArray<'_>) -> Result<Size, Errno> {
1695
- let mut rp0 = MaybeUninit::<Size>::uninit();
1696
- let ret = wasi_snapshot_preview1::fd_write(
1697
- fd as i32,
1698
- iovs.as_ptr() as i32,
1699
- iovs.len() as i32,
1700
- rp0.as_mut_ptr() as i32,
1701
- );
1702
- match ret {
1703
- 0 => Ok(core::ptr::read(rp0.as_mut_ptr() as i32 as *const Size)),
1704
- _ => Err(Errno(ret as u16)),
1705
- }
1706
- }
1707
-
1708
- /// Create a directory.
1709
- /// Note: This is similar to `mkdirat` in POSIX.
1710
- ///
1711
- /// ## Parameters
1712
- ///
1713
- /// * `path` - The path at which to create the directory.
1714
- pub unsafe fn path_create_directory(fd: Fd, path: &str) -> Result<(), Errno> {
1715
- let ret = wasi_snapshot_preview1::path_create_directory(
1716
- fd as i32,
1717
- path.as_ptr() as i32,
1718
- path.len() as i32,
1719
- );
1720
- match ret {
1721
- 0 => Ok(()),
1722
- _ => Err(Errno(ret as u16)),
1723
- }
1724
- }
1725
-
1726
- /// Return the attributes of a file or directory.
1727
- /// Note: This is similar to `stat` in POSIX.
1728
- ///
1729
- /// ## Parameters
1730
- ///
1731
- /// * `flags` - Flags determining the method of how the path is resolved.
1732
- /// * `path` - The path of the file or directory to inspect.
1733
- ///
1734
- /// ## Return
1735
- ///
1736
- /// The buffer where the file's attributes are stored.
1737
- pub unsafe fn path_filestat_get(fd: Fd, flags: Lookupflags, path: &str) -> Result<Filestat, Errno> {
1738
- let mut rp0 = MaybeUninit::<Filestat>::uninit();
1739
- let ret = wasi_snapshot_preview1::path_filestat_get(
1740
- fd as i32,
1741
- flags as i32,
1742
- path.as_ptr() as i32,
1743
- path.len() as i32,
1744
- rp0.as_mut_ptr() as i32,
1745
- );
1746
- match ret {
1747
- 0 => Ok(core::ptr::read(rp0.as_mut_ptr() as i32 as *const Filestat)),
1748
- _ => Err(Errno(ret as u16)),
1749
- }
1750
- }
1751
-
1752
- /// Adjust the timestamps of a file or directory.
1753
- /// Note: This is similar to `utimensat` in POSIX.
1754
- ///
1755
- /// ## Parameters
1756
- ///
1757
- /// * `flags` - Flags determining the method of how the path is resolved.
1758
- /// * `path` - The path of the file or directory to operate on.
1759
- /// * `atim` - The desired values of the data access timestamp.
1760
- /// * `mtim` - The desired values of the data modification timestamp.
1761
- /// * `fst_flags` - A bitmask indicating which timestamps to adjust.
1762
- pub unsafe fn path_filestat_set_times(
1763
- fd: Fd,
1764
- flags: Lookupflags,
1765
- path: &str,
1766
- atim: Timestamp,
1767
- mtim: Timestamp,
1768
- fst_flags: Fstflags,
1769
- ) -> Result<(), Errno> {
1770
- let ret = wasi_snapshot_preview1::path_filestat_set_times(
1771
- fd as i32,
1772
- flags as i32,
1773
- path.as_ptr() as i32,
1774
- path.len() as i32,
1775
- atim as i64,
1776
- mtim as i64,
1777
- fst_flags as i32,
1778
- );
1779
- match ret {
1780
- 0 => Ok(()),
1781
- _ => Err(Errno(ret as u16)),
1782
- }
1783
- }
1784
-
1785
- /// Create a hard link.
1786
- /// Note: This is similar to `linkat` in POSIX.
1787
- ///
1788
- /// ## Parameters
1789
- ///
1790
- /// * `old_flags` - Flags determining the method of how the path is resolved.
1791
- /// * `old_path` - The source path from which to link.
1792
- /// * `new_fd` - The working directory at which the resolution of the new path starts.
1793
- /// * `new_path` - The destination path at which to create the hard link.
1794
- pub unsafe fn path_link(
1795
- old_fd: Fd,
1796
- old_flags: Lookupflags,
1797
- old_path: &str,
1798
- new_fd: Fd,
1799
- new_path: &str,
1800
- ) -> Result<(), Errno> {
1801
- let ret = wasi_snapshot_preview1::path_link(
1802
- old_fd as i32,
1803
- old_flags as i32,
1804
- old_path.as_ptr() as i32,
1805
- old_path.len() as i32,
1806
- new_fd as i32,
1807
- new_path.as_ptr() as i32,
1808
- new_path.len() as i32,
1809
- );
1810
- match ret {
1811
- 0 => Ok(()),
1812
- _ => Err(Errno(ret as u16)),
1813
- }
1814
- }
1815
-
1816
- /// Open a file or directory.
1817
- /// The returned file descriptor is not guaranteed to be the lowest-numbered
1818
- /// file descriptor not currently open; it is randomized to prevent
1819
- /// applications from depending on making assumptions about indexes, since this
1820
- /// is error-prone in multi-threaded contexts. The returned file descriptor is
1821
- /// guaranteed to be less than 2**31.
1822
- /// Note: This is similar to `openat` in POSIX.
1823
- ///
1824
- /// ## Parameters
1825
- ///
1826
- /// * `dirflags` - Flags determining the method of how the path is resolved.
1827
- /// * `path` - The relative path of the file or directory to open, relative to the
1828
- /// `path_open::fd` directory.
1829
- /// * `oflags` - The method by which to open the file.
1830
- /// * `fs_rights_base` - The initial rights of the newly created file descriptor. The
1831
- /// implementation is allowed to return a file descriptor with fewer rights
1832
- /// than specified, if and only if those rights do not apply to the type of
1833
- /// file being opened.
1834
- /// The *base* rights are rights that will apply to operations using the file
1835
- /// descriptor itself, while the *inheriting* rights are rights that apply to
1836
- /// file descriptors derived from it.
1837
- ///
1838
- /// ## Return
1839
- ///
1840
- /// The file descriptor of the file that has been opened.
1841
- pub unsafe fn path_open(
1842
- fd: Fd,
1843
- dirflags: Lookupflags,
1844
- path: &str,
1845
- oflags: Oflags,
1846
- fs_rights_base: Rights,
1847
- fs_rights_inheriting: Rights,
1848
- fdflags: Fdflags,
1849
- ) -> Result<Fd, Errno> {
1850
- let mut rp0 = MaybeUninit::<Fd>::uninit();
1851
- let ret = wasi_snapshot_preview1::path_open(
1852
- fd as i32,
1853
- dirflags as i32,
1854
- path.as_ptr() as i32,
1855
- path.len() as i32,
1856
- oflags as i32,
1857
- fs_rights_base as i64,
1858
- fs_rights_inheriting as i64,
1859
- fdflags as i32,
1860
- rp0.as_mut_ptr() as i32,
1861
- );
1862
- match ret {
1863
- 0 => Ok(core::ptr::read(rp0.as_mut_ptr() as i32 as *const Fd)),
1864
- _ => Err(Errno(ret as u16)),
1865
- }
1866
- }
1867
-
1868
- /// Read the contents of a symbolic link.
1869
- /// Note: This is similar to `readlinkat` in POSIX.
1870
- ///
1871
- /// ## Parameters
1872
- ///
1873
- /// * `path` - The path of the symbolic link from which to read.
1874
- /// * `buf` - The buffer to which to write the contents of the symbolic link.
1875
- ///
1876
- /// ## Return
1877
- ///
1878
- /// The number of bytes placed in the buffer.
1879
- pub unsafe fn path_readlink(
1880
- fd: Fd,
1881
- path: &str,
1882
- buf: *mut u8,
1883
- buf_len: Size,
1884
- ) -> Result<Size, Errno> {
1885
- let mut rp0 = MaybeUninit::<Size>::uninit();
1886
- let ret = wasi_snapshot_preview1::path_readlink(
1887
- fd as i32,
1888
- path.as_ptr() as i32,
1889
- path.len() as i32,
1890
- buf as i32,
1891
- buf_len as i32,
1892
- rp0.as_mut_ptr() as i32,
1893
- );
1894
- match ret {
1895
- 0 => Ok(core::ptr::read(rp0.as_mut_ptr() as i32 as *const Size)),
1896
- _ => Err(Errno(ret as u16)),
1897
- }
1898
- }
1899
-
1900
- /// Remove a directory.
1901
- /// Return `errno::notempty` if the directory is not empty.
1902
- /// Note: This is similar to `unlinkat(fd, path, AT_REMOVEDIR)` in POSIX.
1903
- ///
1904
- /// ## Parameters
1905
- ///
1906
- /// * `path` - The path to a directory to remove.
1907
- pub unsafe fn path_remove_directory(fd: Fd, path: &str) -> Result<(), Errno> {
1908
- let ret = wasi_snapshot_preview1::path_remove_directory(
1909
- fd as i32,
1910
- path.as_ptr() as i32,
1911
- path.len() as i32,
1912
- );
1913
- match ret {
1914
- 0 => Ok(()),
1915
- _ => Err(Errno(ret as u16)),
1916
- }
1917
- }
1918
-
1919
- /// Rename a file or directory.
1920
- /// Note: This is similar to `renameat` in POSIX.
1921
- ///
1922
- /// ## Parameters
1923
- ///
1924
- /// * `old_path` - The source path of the file or directory to rename.
1925
- /// * `new_fd` - The working directory at which the resolution of the new path starts.
1926
- /// * `new_path` - The destination path to which to rename the file or directory.
1927
- pub unsafe fn path_rename(fd: Fd, old_path: &str, new_fd: Fd, new_path: &str) -> Result<(), Errno> {
1928
- let ret = wasi_snapshot_preview1::path_rename(
1929
- fd as i32,
1930
- old_path.as_ptr() as i32,
1931
- old_path.len() as i32,
1932
- new_fd as i32,
1933
- new_path.as_ptr() as i32,
1934
- new_path.len() as i32,
1935
- );
1936
- match ret {
1937
- 0 => Ok(()),
1938
- _ => Err(Errno(ret as u16)),
1939
- }
1940
- }
1941
-
1942
- /// Create a symbolic link.
1943
- /// Note: This is similar to `symlinkat` in POSIX.
1944
- ///
1945
- /// ## Parameters
1946
- ///
1947
- /// * `old_path` - The contents of the symbolic link.
1948
- /// * `new_path` - The destination path at which to create the symbolic link.
1949
- pub unsafe fn path_symlink(old_path: &str, fd: Fd, new_path: &str) -> Result<(), Errno> {
1950
- let ret = wasi_snapshot_preview1::path_symlink(
1951
- old_path.as_ptr() as i32,
1952
- old_path.len() as i32,
1953
- fd as i32,
1954
- new_path.as_ptr() as i32,
1955
- new_path.len() as i32,
1956
- );
1957
- match ret {
1958
- 0 => Ok(()),
1959
- _ => Err(Errno(ret as u16)),
1960
- }
1961
- }
1962
-
1963
- /// Unlink a file.
1964
- /// Return `errno::isdir` if the path refers to a directory.
1965
- /// Note: This is similar to `unlinkat(fd, path, 0)` in POSIX.
1966
- ///
1967
- /// ## Parameters
1968
- ///
1969
- /// * `path` - The path to a file to unlink.
1970
- pub unsafe fn path_unlink_file(fd: Fd, path: &str) -> Result<(), Errno> {
1971
- let ret = wasi_snapshot_preview1::path_unlink_file(
1972
- fd as i32,
1973
- path.as_ptr() as i32,
1974
- path.len() as i32,
1975
- );
1976
- match ret {
1977
- 0 => Ok(()),
1978
- _ => Err(Errno(ret as u16)),
1979
- }
1980
- }
1981
-
1982
- /// Concurrently poll for the occurrence of a set of events.
1983
- ///
1984
- /// ## Parameters
1985
- ///
1986
- /// * `in_` - The events to which to subscribe.
1987
- /// * `out` - The events that have occurred.
1988
- /// * `nsubscriptions` - Both the number of subscriptions and events.
1989
- ///
1990
- /// ## Return
1991
- ///
1992
- /// The number of events stored.
1993
- pub unsafe fn poll_oneoff(
1994
- in_: *const Subscription,
1995
- out: *mut Event,
1996
- nsubscriptions: Size,
1997
- ) -> Result<Size, Errno> {
1998
- let mut rp0 = MaybeUninit::<Size>::uninit();
1999
- let ret = wasi_snapshot_preview1::poll_oneoff(
2000
- in_ as i32,
2001
- out as i32,
2002
- nsubscriptions as i32,
2003
- rp0.as_mut_ptr() as i32,
2004
- );
2005
- match ret {
2006
- 0 => Ok(core::ptr::read(rp0.as_mut_ptr() as i32 as *const Size)),
2007
- _ => Err(Errno(ret as u16)),
2008
- }
2009
- }
2010
-
2011
- /// Terminate the process normally. An exit code of 0 indicates successful
2012
- /// termination of the program. The meanings of other values is dependent on
2013
- /// the environment.
2014
- ///
2015
- /// ## Parameters
2016
- ///
2017
- /// * `rval` - The exit code returned by the process.
2018
- pub unsafe fn proc_exit(rval: Exitcode) {
2019
- wasi_snapshot_preview1::proc_exit(rval as i32);
2020
- }
2021
-
2022
- /// Send a signal to the process of the calling thread.
2023
- /// Note: This is similar to `raise` in POSIX.
2024
- ///
2025
- /// ## Parameters
2026
- ///
2027
- /// * `sig` - The signal condition to trigger.
2028
- pub unsafe fn proc_raise(sig: Signal) -> Result<(), Errno> {
2029
- let ret = wasi_snapshot_preview1::proc_raise(sig.0 as i32);
2030
- match ret {
2031
- 0 => Ok(()),
2032
- _ => Err(Errno(ret as u16)),
2033
- }
2034
- }
2035
-
2036
- /// Temporarily yield execution of the calling thread.
2037
- /// Note: This is similar to `sched_yield` in POSIX.
2038
- pub unsafe fn sched_yield() -> Result<(), Errno> {
2039
- let ret = wasi_snapshot_preview1::sched_yield();
2040
- match ret {
2041
- 0 => Ok(()),
2042
- _ => Err(Errno(ret as u16)),
2043
- }
2044
- }
2045
-
2046
- /// Write high-quality random data into a buffer.
2047
- /// This function blocks when the implementation is unable to immediately
2048
- /// provide sufficient high-quality random data.
2049
- /// This function may execute slowly, so when large mounts of random data are
2050
- /// required, it's advisable to use this function to seed a pseudo-random
2051
- /// number generator, rather than to provide the random data directly.
2052
- ///
2053
- /// ## Parameters
2054
- ///
2055
- /// * `buf` - The buffer to fill with random data.
2056
- pub unsafe fn random_get(buf: *mut u8, buf_len: Size) -> Result<(), Errno> {
2057
- let ret = wasi_snapshot_preview1::random_get(buf as i32, buf_len as i32);
2058
- match ret {
2059
- 0 => Ok(()),
2060
- _ => Err(Errno(ret as u16)),
2061
- }
2062
- }
2063
-
2064
- /// Accept a new incoming connection.
2065
- /// Note: This is similar to `accept` in POSIX.
2066
- ///
2067
- /// ## Parameters
2068
- ///
2069
- /// * `fd` - The listening socket.
2070
- /// * `flags` - The desired values of the file descriptor flags.
2071
- ///
2072
- /// ## Return
2073
- ///
2074
- /// New socket connection
2075
- pub unsafe fn sock_accept(fd: Fd, flags: Fdflags) -> Result<Fd, Errno> {
2076
- let mut rp0 = MaybeUninit::<Fd>::uninit();
2077
- let ret = wasi_snapshot_preview1::sock_accept(fd as i32, flags as i32, rp0.as_mut_ptr() as i32);
2078
- match ret {
2079
- 0 => Ok(core::ptr::read(rp0.as_mut_ptr() as i32 as *const Fd)),
2080
- _ => Err(Errno(ret as u16)),
2081
- }
2082
- }
2083
-
2084
- /// Receive a message from a socket.
2085
- /// Note: This is similar to `recv` in POSIX, though it also supports reading
2086
- /// the data into multiple buffers in the manner of `readv`.
2087
- ///
2088
- /// ## Parameters
2089
- ///
2090
- /// * `ri_data` - List of scatter/gather vectors to which to store data.
2091
- /// * `ri_flags` - Message flags.
2092
- ///
2093
- /// ## Return
2094
- ///
2095
- /// Number of bytes stored in ri_data and message flags.
2096
- pub unsafe fn sock_recv(
2097
- fd: Fd,
2098
- ri_data: IovecArray<'_>,
2099
- ri_flags: Riflags,
2100
- ) -> Result<(Size, Roflags), Errno> {
2101
- let mut rp0 = MaybeUninit::<Size>::uninit();
2102
- let mut rp1 = MaybeUninit::<Roflags>::uninit();
2103
- let ret = wasi_snapshot_preview1::sock_recv(
2104
- fd as i32,
2105
- ri_data.as_ptr() as i32,
2106
- ri_data.len() as i32,
2107
- ri_flags as i32,
2108
- rp0.as_mut_ptr() as i32,
2109
- rp1.as_mut_ptr() as i32,
2110
- );
2111
- match ret {
2112
- 0 => Ok((
2113
- core::ptr::read(rp0.as_mut_ptr() as i32 as *const Size),
2114
- core::ptr::read(rp1.as_mut_ptr() as i32 as *const Roflags),
2115
- )),
2116
- _ => Err(Errno(ret as u16)),
2117
- }
2118
- }
2119
-
2120
- /// Send a message on a socket.
2121
- /// Note: This is similar to `send` in POSIX, though it also supports writing
2122
- /// the data from multiple buffers in the manner of `writev`.
2123
- ///
2124
- /// ## Parameters
2125
- ///
2126
- /// * `si_data` - List of scatter/gather vectors to which to retrieve data
2127
- /// * `si_flags` - Message flags.
2128
- ///
2129
- /// ## Return
2130
- ///
2131
- /// Number of bytes transmitted.
2132
- pub unsafe fn sock_send(
2133
- fd: Fd,
2134
- si_data: CiovecArray<'_>,
2135
- si_flags: Siflags,
2136
- ) -> Result<Size, Errno> {
2137
- let mut rp0 = MaybeUninit::<Size>::uninit();
2138
- let ret = wasi_snapshot_preview1::sock_send(
2139
- fd as i32,
2140
- si_data.as_ptr() as i32,
2141
- si_data.len() as i32,
2142
- si_flags as i32,
2143
- rp0.as_mut_ptr() as i32,
2144
- );
2145
- match ret {
2146
- 0 => Ok(core::ptr::read(rp0.as_mut_ptr() as i32 as *const Size)),
2147
- _ => Err(Errno(ret as u16)),
2148
- }
2149
- }
2150
-
2151
- /// Shut down socket send and receive channels.
2152
- /// Note: This is similar to `shutdown` in POSIX.
2153
- ///
2154
- /// ## Parameters
2155
- ///
2156
- /// * `how` - Which channels on the socket to shut down.
2157
- pub unsafe fn sock_shutdown(fd: Fd, how: Sdflags) -> Result<(), Errno> {
2158
- let ret = wasi_snapshot_preview1::sock_shutdown(fd as i32, how as i32);
2159
- match ret {
2160
- 0 => Ok(()),
2161
- _ => Err(Errno(ret as u16)),
2162
- }
2163
- }
2164
-
2165
- pub mod wasi_snapshot_preview1 {
2166
- #[link(wasm_import_module = "wasi_snapshot_preview1")]
2167
- extern "C" {
2168
- /// Read command-line argument data.
2169
- /// The size of the array should match that returned by `args_sizes_get`.
2170
- /// Each argument is expected to be `\0` terminated.
2171
- pub fn args_get(arg0: i32, arg1: i32) -> i32;
2172
- /// Return command-line argument data sizes.
2173
- pub fn args_sizes_get(arg0: i32, arg1: i32) -> i32;
2174
- /// Read environment variable data.
2175
- /// The sizes of the buffers should match that returned by `environ_sizes_get`.
2176
- /// Key/value pairs are expected to be joined with `=`s, and terminated with `\0`s.
2177
- pub fn environ_get(arg0: i32, arg1: i32) -> i32;
2178
- /// Return environment variable data sizes.
2179
- pub fn environ_sizes_get(arg0: i32, arg1: i32) -> i32;
2180
- /// Return the resolution of a clock.
2181
- /// Implementations are required to provide a non-zero value for supported clocks. For unsupported clocks,
2182
- /// return `errno::inval`.
2183
- /// Note: This is similar to `clock_getres` in POSIX.
2184
- pub fn clock_res_get(arg0: i32, arg1: i32) -> i32;
2185
- /// Return the time value of a clock.
2186
- /// Note: This is similar to `clock_gettime` in POSIX.
2187
- pub fn clock_time_get(arg0: i32, arg1: i64, arg2: i32) -> i32;
2188
- /// Provide file advisory information on a file descriptor.
2189
- /// Note: This is similar to `posix_fadvise` in POSIX.
2190
- pub fn fd_advise(arg0: i32, arg1: i64, arg2: i64, arg3: i32) -> i32;
2191
- /// Force the allocation of space in a file.
2192
- /// Note: This is similar to `posix_fallocate` in POSIX.
2193
- pub fn fd_allocate(arg0: i32, arg1: i64, arg2: i64) -> i32;
2194
- /// Close a file descriptor.
2195
- /// Note: This is similar to `close` in POSIX.
2196
- pub fn fd_close(arg0: i32) -> i32;
2197
- /// Synchronize the data of a file to disk.
2198
- /// Note: This is similar to `fdatasync` in POSIX.
2199
- pub fn fd_datasync(arg0: i32) -> i32;
2200
- /// Get the attributes of a file descriptor.
2201
- /// Note: This returns similar flags to `fsync(fd, F_GETFL)` in POSIX, as well as additional fields.
2202
- pub fn fd_fdstat_get(arg0: i32, arg1: i32) -> i32;
2203
- /// Adjust the flags associated with a file descriptor.
2204
- /// Note: This is similar to `fcntl(fd, F_SETFL, flags)` in POSIX.
2205
- pub fn fd_fdstat_set_flags(arg0: i32, arg1: i32) -> i32;
2206
- /// Adjust the rights associated with a file descriptor.
2207
- /// This can only be used to remove rights, and returns `errno::notcapable` if called in a way that would attempt to add rights
2208
- pub fn fd_fdstat_set_rights(arg0: i32, arg1: i64, arg2: i64) -> i32;
2209
- /// Return the attributes of an open file.
2210
- pub fn fd_filestat_get(arg0: i32, arg1: i32) -> i32;
2211
- /// Adjust the size of an open file. If this increases the file's size, the extra bytes are filled with zeros.
2212
- /// Note: This is similar to `ftruncate` in POSIX.
2213
- pub fn fd_filestat_set_size(arg0: i32, arg1: i64) -> i32;
2214
- /// Adjust the timestamps of an open file or directory.
2215
- /// Note: This is similar to `futimens` in POSIX.
2216
- pub fn fd_filestat_set_times(arg0: i32, arg1: i64, arg2: i64, arg3: i32) -> i32;
2217
- /// Read from a file descriptor, without using and updating the file descriptor's offset.
2218
- /// Note: This is similar to `preadv` in POSIX.
2219
- pub fn fd_pread(arg0: i32, arg1: i32, arg2: i32, arg3: i64, arg4: i32) -> i32;
2220
- /// Return a description of the given preopened file descriptor.
2221
- pub fn fd_prestat_get(arg0: i32, arg1: i32) -> i32;
2222
- /// Return a description of the given preopened file descriptor.
2223
- pub fn fd_prestat_dir_name(arg0: i32, arg1: i32, arg2: i32) -> i32;
2224
- /// Write to a file descriptor, without using and updating the file descriptor's offset.
2225
- /// Note: This is similar to `pwritev` in POSIX.
2226
- pub fn fd_pwrite(arg0: i32, arg1: i32, arg2: i32, arg3: i64, arg4: i32) -> i32;
2227
- /// Read from a file descriptor.
2228
- /// Note: This is similar to `readv` in POSIX.
2229
- pub fn fd_read(arg0: i32, arg1: i32, arg2: i32, arg3: i32) -> i32;
2230
- /// Read directory entries from a directory.
2231
- /// When successful, the contents of the output buffer consist of a sequence of
2232
- /// directory entries. Each directory entry consists of a `dirent` object,
2233
- /// followed by `dirent::d_namlen` bytes holding the name of the directory
2234
- /// entry.
2235
- /// This function fills the output buffer as much as possible, potentially
2236
- /// truncating the last directory entry. This allows the caller to grow its
2237
- /// read buffer size in case it's too small to fit a single large directory
2238
- /// entry, or skip the oversized directory entry.
2239
- pub fn fd_readdir(arg0: i32, arg1: i32, arg2: i32, arg3: i64, arg4: i32) -> i32;
2240
- /// Atomically replace a file descriptor by renumbering another file descriptor.
2241
- /// Due to the strong focus on thread safety, this environment does not provide
2242
- /// a mechanism to duplicate or renumber a file descriptor to an arbitrary
2243
- /// number, like `dup2()`. This would be prone to race conditions, as an actual
2244
- /// file descriptor with the same number could be allocated by a different
2245
- /// thread at the same time.
2246
- /// This function provides a way to atomically renumber file descriptors, which
2247
- /// would disappear if `dup2()` were to be removed entirely.
2248
- pub fn fd_renumber(arg0: i32, arg1: i32) -> i32;
2249
- /// Move the offset of a file descriptor.
2250
- /// Note: This is similar to `lseek` in POSIX.
2251
- pub fn fd_seek(arg0: i32, arg1: i64, arg2: i32, arg3: i32) -> i32;
2252
- /// Synchronize the data and metadata of a file to disk.
2253
- /// Note: This is similar to `fsync` in POSIX.
2254
- pub fn fd_sync(arg0: i32) -> i32;
2255
- /// Return the current offset of a file descriptor.
2256
- /// Note: This is similar to `lseek(fd, 0, SEEK_CUR)` in POSIX.
2257
- pub fn fd_tell(arg0: i32, arg1: i32) -> i32;
2258
- /// Write to a file descriptor.
2259
- /// Note: This is similar to `writev` in POSIX.
2260
- pub fn fd_write(arg0: i32, arg1: i32, arg2: i32, arg3: i32) -> i32;
2261
- /// Create a directory.
2262
- /// Note: This is similar to `mkdirat` in POSIX.
2263
- pub fn path_create_directory(arg0: i32, arg1: i32, arg2: i32) -> i32;
2264
- /// Return the attributes of a file or directory.
2265
- /// Note: This is similar to `stat` in POSIX.
2266
- pub fn path_filestat_get(arg0: i32, arg1: i32, arg2: i32, arg3: i32, arg4: i32) -> i32;
2267
- /// Adjust the timestamps of a file or directory.
2268
- /// Note: This is similar to `utimensat` in POSIX.
2269
- pub fn path_filestat_set_times(
2270
- arg0: i32,
2271
- arg1: i32,
2272
- arg2: i32,
2273
- arg3: i32,
2274
- arg4: i64,
2275
- arg5: i64,
2276
- arg6: i32,
2277
- ) -> i32;
2278
- /// Create a hard link.
2279
- /// Note: This is similar to `linkat` in POSIX.
2280
- pub fn path_link(
2281
- arg0: i32,
2282
- arg1: i32,
2283
- arg2: i32,
2284
- arg3: i32,
2285
- arg4: i32,
2286
- arg5: i32,
2287
- arg6: i32,
2288
- ) -> i32;
2289
- /// Open a file or directory.
2290
- /// The returned file descriptor is not guaranteed to be the lowest-numbered
2291
- /// file descriptor not currently open; it is randomized to prevent
2292
- /// applications from depending on making assumptions about indexes, since this
2293
- /// is error-prone in multi-threaded contexts. The returned file descriptor is
2294
- /// guaranteed to be less than 2**31.
2295
- /// Note: This is similar to `openat` in POSIX.
2296
- pub fn path_open(
2297
- arg0: i32,
2298
- arg1: i32,
2299
- arg2: i32,
2300
- arg3: i32,
2301
- arg4: i32,
2302
- arg5: i64,
2303
- arg6: i64,
2304
- arg7: i32,
2305
- arg8: i32,
2306
- ) -> i32;
2307
- /// Read the contents of a symbolic link.
2308
- /// Note: This is similar to `readlinkat` in POSIX.
2309
- pub fn path_readlink(
2310
- arg0: i32,
2311
- arg1: i32,
2312
- arg2: i32,
2313
- arg3: i32,
2314
- arg4: i32,
2315
- arg5: i32,
2316
- ) -> i32;
2317
- /// Remove a directory.
2318
- /// Return `errno::notempty` if the directory is not empty.
2319
- /// Note: This is similar to `unlinkat(fd, path, AT_REMOVEDIR)` in POSIX.
2320
- pub fn path_remove_directory(arg0: i32, arg1: i32, arg2: i32) -> i32;
2321
- /// Rename a file or directory.
2322
- /// Note: This is similar to `renameat` in POSIX.
2323
- pub fn path_rename(arg0: i32, arg1: i32, arg2: i32, arg3: i32, arg4: i32, arg5: i32)
2324
- -> i32;
2325
- /// Create a symbolic link.
2326
- /// Note: This is similar to `symlinkat` in POSIX.
2327
- pub fn path_symlink(arg0: i32, arg1: i32, arg2: i32, arg3: i32, arg4: i32) -> i32;
2328
- /// Unlink a file.
2329
- /// Return `errno::isdir` if the path refers to a directory.
2330
- /// Note: This is similar to `unlinkat(fd, path, 0)` in POSIX.
2331
- pub fn path_unlink_file(arg0: i32, arg1: i32, arg2: i32) -> i32;
2332
- /// Concurrently poll for the occurrence of a set of events.
2333
- pub fn poll_oneoff(arg0: i32, arg1: i32, arg2: i32, arg3: i32) -> i32;
2334
- /// Terminate the process normally. An exit code of 0 indicates successful
2335
- /// termination of the program. The meanings of other values is dependent on
2336
- /// the environment.
2337
- pub fn proc_exit(arg0: i32) -> !;
2338
- /// Send a signal to the process of the calling thread.
2339
- /// Note: This is similar to `raise` in POSIX.
2340
- pub fn proc_raise(arg0: i32) -> i32;
2341
- /// Temporarily yield execution of the calling thread.
2342
- /// Note: This is similar to `sched_yield` in POSIX.
2343
- pub fn sched_yield() -> i32;
2344
- /// Write high-quality random data into a buffer.
2345
- /// This function blocks when the implementation is unable to immediately
2346
- /// provide sufficient high-quality random data.
2347
- /// This function may execute slowly, so when large mounts of random data are
2348
- /// required, it's advisable to use this function to seed a pseudo-random
2349
- /// number generator, rather than to provide the random data directly.
2350
- pub fn random_get(arg0: i32, arg1: i32) -> i32;
2351
- /// Accept a new incoming connection.
2352
- /// Note: This is similar to `accept` in POSIX.
2353
- pub fn sock_accept(arg0: i32, arg1: i32, arg2: i32) -> i32;
2354
- /// Receive a message from a socket.
2355
- /// Note: This is similar to `recv` in POSIX, though it also supports reading
2356
- /// the data into multiple buffers in the manner of `readv`.
2357
- pub fn sock_recv(arg0: i32, arg1: i32, arg2: i32, arg3: i32, arg4: i32, arg5: i32) -> i32;
2358
- /// Send a message on a socket.
2359
- /// Note: This is similar to `send` in POSIX, though it also supports writing
2360
- /// the data from multiple buffers in the manner of `writev`.
2361
- pub fn sock_send(arg0: i32, arg1: i32, arg2: i32, arg3: i32, arg4: i32) -> i32;
2362
- /// Shut down socket send and receive channels.
2363
- /// Note: This is similar to `shutdown` in POSIX.
2364
- pub fn sock_shutdown(arg0: i32, arg1: i32) -> i32;
2365
- }
2366
- }