Skip to main content

Data

Trait Data 

Source
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§

Source

fn into_boxed(self) -> Box<dyn Any>

Source

fn into_raw(self) -> NonNullFREData

Source

fn from_boxed(boxed: Box<dyn Any>) -> Result<Self, Box<dyn Any>>

Source

unsafe fn from_raw(raw: NonNullFREData) -> Self

Source

unsafe fn ref_from<'a>(raw: NonNullFREData) -> Result<&'a Self, &'a dyn Any>

Source

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.

Implementations on Foreign Types§

Source§

impl Data for ()

Source§

impl Data for Arc<Mutex<Box<dyn Any>>>

Source§

impl Data for RefCell<ContextRegistry>

Implementors§