#[repr(C)]pub struct TypeLut<'a> {
pub num_entries: u32,
/* private fields */
}
Expand description
Represents a lookup table for type information. This is used for runtime linking.
Type IDs and handles are stored separately for cache efficiency.
Fields§
§num_entries: u32
Number of types
Implementations§
source§impl<'a> TypeLut<'a>
impl<'a> TypeLut<'a>
sourcepub fn iter(&self) -> impl Iterator<Item = (&TypeId<'_>, &*const c_void, &str)>
pub fn iter(&self) -> impl Iterator<Item = (&TypeId<'_>, &*const c_void, &str)>
Returns an iterator over pairs of type IDs and type handles.
sourcepub fn iter_mut(
&mut self
) -> impl Iterator<Item = (&TypeId<'_>, &mut *const c_void, &str)>
pub fn iter_mut(
&mut self
) -> impl Iterator<Item = (&TypeId<'_>, &mut *const c_void, &str)>
Returns an iterator over pairs of type IDs and mutable type handles.
sourcepub fn type_handles_mut(&mut self) -> &mut [*const c_void]
pub fn type_handles_mut(&mut self) -> &mut [*const c_void]
Returns mutable type handles.
sourcepub unsafe fn get_type_handle_unchecked(&self, idx: u32) -> *const c_void
pub unsafe fn get_type_handle_unchecked(&self, idx: u32) -> *const c_void
Returns a type handle, without doing bounds checking.
This is generally not recommended, use with caution! Calling this method with an out-of-bounds index is undefined behavior even if the resulting reference is not used. For a safe alternative see get_ptr.
Safety
The idx
is not bounds checked and should therefor be used with care.
sourcepub fn get_type_handle(&self, idx: u32) -> Option<*const c_void>
pub fn get_type_handle(&self, idx: u32) -> Option<*const c_void>
Returns a type handle at the given index, or None
if out of bounds.
sourcepub unsafe fn get_type_handle_unchecked_mut(
&mut self,
idx: u32
) -> &mut *const c_void
pub unsafe fn get_type_handle_unchecked_mut(
&mut self,
idx: u32
) -> &mut *const c_void
Returns a mutable reference to a type handle, without doing bounds checking.
This is generally not recommended, use with caution! Calling this method with an out-of-bounds index is undefined behavior even if the resulting reference is not used. For a safe alternative see get_ptr_mut.
Safety
The idx
is not bounds checked and should therefor be used with care.
sourcepub fn get_type_handle_mut(&mut self, idx: u32) -> Option<&mut *const c_void>
pub fn get_type_handle_mut(&mut self, idx: u32) -> Option<&mut *const c_void>
Returns a mutable reference to a type handle at the given index, or None
if out of
bounds.
sourcepub fn type_names(&self) -> impl Iterator<Item = &str>
pub fn type_names(&self) -> impl Iterator<Item = &str>
Returns type names.