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: u32Number 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.
Auto Trait Implementations§
impl<'a> Freeze for TypeLut<'a>
impl<'a> RefUnwindSafe for TypeLut<'a>
impl<'a> !Send for TypeLut<'a>
impl<'a> !Sync for TypeLut<'a>
impl<'a> Unpin for TypeLut<'a>
impl<'a> UnwindSafe for TypeLut<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more