Struct mun_memory::type_table::TypeTable
source · pub struct TypeTable { /* private fields */ }
Implementations§
source§impl TypeTable
impl TypeTable
sourcepub fn find_type_info_by_name<S: AsRef<str>>(&self, name: S) -> Option<Type>
pub fn find_type_info_by_name<S: AsRef<str>>(&self, name: S) -> Option<Type>
Returns the TypeInfo for the type with the given name.
sourcepub fn find_type_info_by_id<'abi>(
&self,
type_id: &'abi TypeId<'abi>
) -> Option<Type>
pub fn find_type_info_by_id<'abi>(
&self,
type_id: &'abi TypeId<'abi>
) -> Option<Type>
Returns the [TypeInfo
] referenced by the given abi::TypeId
.
sourcepub fn insert_type(&mut self, type_info: Type) -> Option<Type>
pub fn insert_type(&mut self, type_info: Type) -> Option<Type>
Inserts type_info
into the type table.
If the type table already contained this type_info
, the value is updated, and the old
value is returned.
sourcepub fn insert_concrete_type(&mut self, guid: Guid, ty: Type) -> Option<Type>
pub fn insert_concrete_type(&mut self, guid: Guid, ty: Type) -> Option<Type>
Inserts the concrete Type
into the type table.
If the type table already contained this type_info
, the value is updated, and the old
value is returned.
sourcepub fn remove_type(&mut self, ty: &Type) -> Option<Type>
pub fn remove_type(&mut self, ty: &Type) -> Option<Type>
Removes the specified TypeInfo from the lookup table.
sourcepub fn remove_type_by_type_info<'abi>(
&mut self,
type_info: &'abi TypeDefinition<'abi>
) -> Option<Type>
pub fn remove_type_by_type_info<'abi>(
&mut self,
type_info: &'abi TypeDefinition<'abi>
) -> Option<Type>
Removes a type described by the given [abi::TypeInfo
]. Returns None
if this instance
doesn’t hold any type that matches type_info
.