diff options
| author | Rubens Brandao <git@rubens.io> | 2024-06-14 14:17:15 -0300 |
|---|---|---|
| committer | Josh Ferrell <josh@vector35.com> | 2024-07-02 15:54:54 -0400 |
| commit | b47f34b2c82e1829d03f327bdcd602a83ae5e08b (patch) | |
| tree | f1c5535c15599d60041bc3f21b26dac5f8593a08 /rust/src/types.rs | |
| parent | 2a532263525a1bdb9f79522c64d5d2a63c373f9f (diff) | |
implement rust Component
Diffstat (limited to 'rust/src/types.rs')
| -rw-r--r-- | rust/src/types.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/rust/src/types.rs b/rust/src/types.rs index 9b2271d5..8fab75dc 100644 --- a/rust/src/types.rs +++ b/rust/src/types.rs @@ -1339,6 +1339,24 @@ impl ToOwned for Type { } } +pub struct ComponentReferencedTypes; +impl CoreArrayProvider for ComponentReferencedTypes{ + type Raw= *mut BNType; + type Context= (); + type Wrapped<'a> = &'a Self; +} + +unsafe impl CoreArrayProviderInner for ComponentReferencedTypes{ + unsafe fn free(raw: *mut Self::Raw, count: usize, _context: &Self::Context) { + BNComponentFreeReferencedTypes(raw, count) + } + + unsafe fn wrap_raw<'a>(raw: &'a Self::Raw, _context: &'a Self::Context) -> Self::Wrapped<'a> { + // SAFETY: BNType and Type are trasparent + core::mem::transmute(raw) + } +} + /////////////////////// // FunctionParameter |
