pub trait Data: 'static + Sized {
// Provided methods
fn into_boxed(self) -> Box<dyn Any> { ... }
fn into_raw(self) -> NonNullFREData { ... }
fn from_boxed(boxed: Box<dyn Any>) -> Result<Self, Box<dyn Any>> { ... }
unsafe fn from_raw(raw: NonNullFREData) -> Self { ... }
unsafe fn ref_from<'a>(raw: NonNullFREData) -> Result<&'a Self, &'a dyn Any> { ... }
unsafe fn mut_from<'a>(
raw: NonNullFREData,
) -> Result<&'a mut Self, &'a mut dyn Any> { ... }
}Expand description
Should be implemented for all native data types to ensure safe pointer passing and correct memory management. Native data includes extension data, context data, and function data.
Provided Methods§
fn into_boxed(self) -> Box<dyn Any>
fn into_raw(self) -> NonNullFREData
fn from_boxed(boxed: Box<dyn Any>) -> Result<Self, Box<dyn Any>>
unsafe fn from_raw(raw: NonNullFREData) -> Self
unsafe fn ref_from<'a>(raw: NonNullFREData) -> Result<&'a Self, &'a dyn Any>
unsafe fn mut_from<'a>( raw: NonNullFREData, ) -> Result<&'a mut Self, &'a mut dyn Any>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.