macro_rules! impl_opaque_ref_counted_facade {
(
$(#[$meta:meta])*
$vis:vis struct $name:ident,
$recycle_fn:path $(,)?
) => { ... };
(
$(#[$meta:meta])*
$vis:vis struct $name:ident,
$recycle_fn:path,
$get_ref_counted_fn:path $(,)?
) => { ... };
}Expand description
Declares a zero-sized facade struct for an opaque refcounted C++ object and implements
HasRefCount and Recyclable for it.
Supported forms:
- Where
fbl::RefCountedis at offset 0 of the C++ object:
fbl::impl_opaque_ref_counted_facade!(
/// Facade type representing the C++ `iommu::Iommu` object.
pub struct Iommu,
cpp_iommu_recycle,
);- Where
fbl::RefCountedis at a non-zero offset or requires a C++ helper function:
fbl::impl_opaque_ref_counted_facade!(
/// Facade type representing the C++ `VmObject` object.
pub struct VmObject,
cpp_vm_object_free,
cpp_vm_object_get_ref_counted,
);