Skip to main content

Module data

Module data 

Source
Expand description

This module provides safe conversions between concrete typed instances and raw pointers for native data.

Box<dyn Any> is a fat pointer stored on the stack. Casting it directly to a raw pointer will truncate its metadata. To preserve type information, the fat pointer must be stored intact on the heap, so it can be safely reconstructed from a raw pointer.

Traits§

Data
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.

Functions§

drop_from
In typical usage of this crate, this function should not be called directly.
from_raw
In typical usage of this crate, this function should not be called directly.
into_raw
In typical usage of this crate, this function should not be called directly.
mut_from
In typical usage of this crate, this function should not be called directly.
ref_from
In typical usage of this crate, this function should not be called directly.