rust: add a utility module for compile-time type checks

It is relatively common in the low-level qemu_api code to assert that
a field of a struct has a specific type; for example, it can be used
to ensure that the fields match what the qemu_api and C code expects
for safety.

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2024-12-11 12:18:06 +01:00
parent ca0d60a6ad
commit 7f65d4e58b
3 changed files with 92 additions and 0 deletions

View file

@ -12,6 +12,7 @@ pub mod bindings;
#[rustfmt::skip]
pub mod prelude;
pub mod assertions;
pub mod bitops;
pub mod c_str;
pub mod callbacks;