#[repr(C)]pub struct CSTL_Type {
pub size: usize,
pub size_rcp: usize,
pub size_rcp_sh: u8,
pub align_lg: u8,
pub use_move_from: u8,
pub internal_flags: u8,
pub copy_from: Option<unsafe extern "C" fn(new_instance: *mut c_void, src: *const c_void)>,
pub move_from: Option<unsafe extern "C" fn(new_instance: *mut c_void, src: *mut c_void)>,
pub destroy: Option<unsafe extern "C" fn(instance: *mut c_void)>,
}Expand description
Basic type info used in place of a type template parameter.
Two CSTL_Type instances are compatible iff their size and alignment
are equal and the bound functions can operate interchangeably.
It is a logic error to use incompatible CSTL_Type instances one
after another when manipulating an object.
Fields§
§size: usizeSize of the type in bytes, including any padding bytes.
Must be a non-zero multiple of 1 << align_lg.
size_rcp: usizeFixed point reciprocal of the type’s size, used for fast division and remainder operations.
Calculated automatically by CSTL_define_*_type.
size_rcp_sh: u8Right shift of the fixed point reciprocal of the type’s size, used for fast division and remainder operations.
Calculated automatically by CSTL_define_*_type.
align_lg: u8Natural alignment of the type in bytes (log2).
Calculated automatically by CSTL_define_*_type.
use_move_from: u8Determines whether move_from can be called on a void* pointer
to an object of this type.
Set by CSTL_define_*_type or manually.
internal_flags: u8Opaque bitfield with unstable ABI.
copy_from: Option<unsafe extern "C" fn(new_instance: *mut c_void, src: *const c_void)>Bound copy constructor function.
It is NOT permitted to mutate the source.
If null a memmove(new_instance, src, size) will be used in its stead.
move_from: Option<unsafe extern "C" fn(new_instance: *mut c_void, src: *mut c_void)>Bound move constructor function.
It is permitted to mutate the source, therefore it is suitable
for a move constructor.
Remember that the moved-from object must stay in a valid state and be able to be destroyed after this call.
If null a memmove(new_instance, src, size) will be used in its stead.
destroy: Option<unsafe extern "C" fn(instance: *mut c_void)>Bound destructor function.
If null a memset(instance, 0xDE, size) will be used in its stead.