qemu/rust
Paolo Bonzini 66bcc554d2 rust: callbacks: allow passing optional callbacks as ()
In some cases, callbacks are optional.  Using "Some(function)" and "None"
does not work well, because when someone writes "None" the compiler does
not know what to use for "F" in "Option<F>".

Therefore, adopt () to mean a "null" callback.  It is possible to enforce
that a callback is valid by adding a "let _: () = F::ASSERT_IS_SOME" before
the invocation of F::call.

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-02-13 12:19:33 +01:00
..
hw rust: qom: add object creation functionality 2025-02-13 12:19:33 +01:00
qemu-api rust: callbacks: allow passing optional callbacks as () 2025-02-13 12:19:33 +01:00
qemu-api-macros rust: include rust_version in Cargo.toml 2025-02-07 00:04:28 +01:00
.gitignore rust: add bindgen step as a meson dependency 2024-10-11 12:32:17 +02:00
Cargo.lock rust: introduce alternative implementation of offset_of! 2024-11-05 14:18:16 +01:00
Cargo.toml rust: restrict missing_const_for_fn to qemu_api crate 2025-02-10 11:18:32 +01:00
clippy.toml rust: add clippy configuration file 2025-02-07 15:51:01 +01:00
Kconfig rust: add PL011 device model 2024-11-05 14:18:15 +01:00
meson.build rust: build: add "make clippy", "make rustfmt", "make rustdoc" 2024-12-10 18:44:06 +01:00
rustfmt.toml rust: add crate to expose bindings and interfaces 2024-10-11 12:32:17 +02:00
wrapper.h include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00