This second version of the Rust bindings splits up the `cbkind` field in
the `closure` structure into `cblifetime` and `cbcount` in API.ml. It also
adds a new field to the `call` structure: `modifies_fd`, which tells
whether the call may modify the file descriptor.
Please comment and give feedback.
Best regards,
Tage
Tage Johansson (10):
rust: create basic Rust bindings
generator: Add information about asynchronous handle calls
generator: Add information about the lifetime of closures
rust: Use more specific closure traits
rust: Add a couple of integration tests
rust: Make it possible to run tests with Valgrind
rust: async: Create an async friendly handle type
rust: async: Add a couple of integration tests
generator: Add `modifies_fd` flag to the [call] structure
rust: async: Use the `modifies_fd` flag to exclude calls
.gitignore | 8 +
.ocamlformat | 4 +
Makefile.am | 1 +
configure.ac | 13 +
generator/API.ml | 84 ++
generator/API.mli | 35 +
generator/Makefile.am | 2 +
generator/Rust.ml | 814 ++++++++++++++++++
generator/Rust.mli | 22 +
generator/generator.ml | 3 +
rust/Cargo.toml | 55 ++
rust/Makefile.am | 76 ++
rust/libnbd-sys/Cargo.toml | 30 +
rust/libnbd-sys/build.rs | 60 ++
rust/libnbd-sys/src/lib.rs | 24 +
rust/libnbd-sys/wrapper.h | 18 +
rust/run-tests.sh | 30 +
rust/src/async_handle.rs | 222 +++++
rust/src/error.rs | 118 +++
rust/src/handle.rs | 67 ++
rust/src/lib.rs | 32 +
rust/src/types.rs | 20 +
rust/src/utils.rs | 23 +
rust/tests/nbdkit_pattern/mod.rs | 28 +
rust/tests/test_100_handle.rs | 25 +
rust/tests/test_110_defaults.rs | 33 +
rust/tests/test_120_set_non_defaults.rs | 56 ++
rust/tests/test_130_private_data.rs | 28 +
rust/tests/test_140_explicit_close.rs | 31 +
rust/tests/test_200_connect_command.rs | 33 +
rust/tests/test_210_opt_abort.rs | 39 +
rust/tests/test_220_opt_list.rs | 85 ++
rust/tests/test_230_opt_info.rs | 124 +++
rust/tests/test_240_opt_list_meta.rs | 151 ++++
rust/tests/test_245_opt_list_meta_queries.rs | 98 +++
rust/tests/test_250_opt_set_meta.rs | 124 +++
rust/tests/test_255_opt_set_meta_queries.rs | 111 +++
rust/tests/test_300_get_size.rs | 36 +
rust/tests/test_400_pread.rs | 40 +
rust/tests/test_405_pread_structured.rs | 80 ++
rust/tests/test_410_pwrite.rs | 62 ++
rust/tests/test_460_block_status.rs | 96 +++
rust/tests/test_620_stats.rs | 76 ++
rust/tests/test_async_100_handle.rs | 25 +
rust/tests/test_async_200_connect_command.rs | 34 +
rust/tests/test_async_210_opt_abort.rs | 40 +
rust/tests/test_async_220_opt_list.rs | 86 ++
rust/tests/test_async_230_opt_info.rs | 126 +++
rust/tests/test_async_235memleak.rs | 57 ++
rust/tests/test_async_240_opt_list_meta.rs | 151 ++++
.../test_async_245_opt_list_meta_queries.rs | 96 +++
rust/tests/test_async_250_opt_set_meta.rs | 123 +++
.../test_async_255_opt_set_meta_queries.rs | 111 +++
rust/tests/test_async_400_pread.rs | 41 +
rust/tests/test_async_405_pread_structured.rs | 85 ++
rust/tests/test_async_410_pwrite.rs | 63 ++
rust/tests/test_async_460_block_status.rs | 96 +++
rust/tests/test_async_620_stats.rs | 77 ++
rust/tests/test_log/mod.rs | 86 ++
rustfmt.toml | 19 +
60 files changed, 4433 insertions(+)
create mode 100644 .ocamlformat
create mode 100644 generator/Rust.ml
create mode 100644 generator/Rust.mli
create mode 100644 rust/Cargo.toml
create mode 100644 rust/Makefile.am
create mode 100644 rust/libnbd-sys/Cargo.toml
create mode 100644 rust/libnbd-sys/build.rs
create mode 100644 rust/libnbd-sys/src/lib.rs
create mode 100644 rust/libnbd-sys/wrapper.h
create mode 100755 rust/run-tests.sh
create mode 100644 rust/src/async_handle.rs
create mode 100644 rust/src/error.rs
create mode 100644 rust/src/handle.rs
create mode 100644 rust/src/lib.rs
create mode 100644 rust/src/types.rs
create mode 100644 rust/src/utils.rs
create mode 100644 rust/tests/nbdkit_pattern/mod.rs
create mode 100644 rust/tests/test_100_handle.rs
create mode 100644 rust/tests/test_110_defaults.rs
create mode 100644 rust/tests/test_120_set_non_defaults.rs
create mode 100644 rust/tests/test_130_private_data.rs
create mode 100644 rust/tests/test_140_explicit_close.rs
create mode 100644 rust/tests/test_200_connect_command.rs
create mode 100644 rust/tests/test_210_opt_abort.rs
create mode 100644 rust/tests/test_220_opt_list.rs
create mode 100644 rust/tests/test_230_opt_info.rs
create mode 100644 rust/tests/test_240_opt_list_meta.rs
create mode 100644 rust/tests/test_245_opt_list_meta_queries.rs
create mode 100644 rust/tests/test_250_opt_set_meta.rs
create mode 100644 rust/tests/test_255_opt_set_meta_queries.rs
create mode 100644 rust/tests/test_300_get_size.rs
create mode 100644 rust/tests/test_400_pread.rs
create mode 100644 rust/tests/test_405_pread_structured.rs
create mode 100644 rust/tests/test_410_pwrite.rs
create mode 100644 rust/tests/test_460_block_status.rs
create mode 100644 rust/tests/test_620_stats.rs
create mode 100644 rust/tests/test_async_100_handle.rs
create mode 100644 rust/tests/test_async_200_connect_command.rs
create mode 100644 rust/tests/test_async_210_opt_abort.rs
create mode 100644 rust/tests/test_async_220_opt_list.rs
create mode 100644 rust/tests/test_async_230_opt_info.rs
create mode 100644 rust/tests/test_async_235memleak.rs
create mode 100644 rust/tests/test_async_240_opt_list_meta.rs
create mode 100644 rust/tests/test_async_245_opt_list_meta_queries.rs
create mode 100644 rust/tests/test_async_250_opt_set_meta.rs
create mode 100644 rust/tests/test_async_255_opt_set_meta_queries.rs
create mode 100644 rust/tests/test_async_400_pread.rs
create mode 100644 rust/tests/test_async_405_pread_structured.rs
create mode 100644 rust/tests/test_async_410_pwrite.rs
create mode 100644 rust/tests/test_async_460_block_status.rs
create mode 100644 rust/tests/test_async_620_stats.rs
create mode 100644 rust/tests/test_log/mod.rs
create mode 100644 rustfmt.toml
base-commit: fbde5974fd5c8a3bcb081db0b1074c4a3e723e76
--
2.41.0