Struct wasmtime_environ::wasmparser::types::TypesRef
source · pub struct TypesRef<'a> { /* private fields */ }
Expand description
Represents the types known to a crate::Validator
during validation.
Retrieved via the crate::Validator::types
method.
Implementations§
source§impl<'a> TypesRef<'a>
impl<'a> TypesRef<'a>
sourcepub fn type_from_id(&self, id: TypeId) -> Option<&'a Type>
pub fn type_from_id(&self, id: TypeId) -> Option<&'a Type>
Gets a type based on its type id.
Returns None
if the type id is unknown.
sourcepub fn id_from_type_index(&self, index: u32, core: bool) -> Option<TypeId>
pub fn id_from_type_index(&self, index: u32, core: bool) -> Option<TypeId>
Gets a type id from a type index.
Returns None
if the type index is out of bounds or the type has not
been parsed yet.
sourcepub fn type_at(&self, index: u32, core: bool) -> Option<&'a Type>
pub fn type_at(&self, index: u32, core: bool) -> Option<&'a Type>
Gets a type at the given type index.
Returns None
if the type index is out of bounds or the type has not
been parsed yet.
sourcepub fn func_type_at(&self, index: u32) -> Option<&'a FuncType>
pub fn func_type_at(&self, index: u32) -> Option<&'a FuncType>
Gets a defined core function type at the given type index.
Returns None
if the type index is out of bounds or the type has not
been parsed yet.
sourcepub fn table_at(&self, index: u32) -> Option<TableType>
pub fn table_at(&self, index: u32) -> Option<TableType>
Gets the type of a table at the given table index.
Returns None
if the type index is out of bounds or the type has not
been parsed yet.
sourcepub fn memory_at(&self, index: u32) -> Option<MemoryType>
pub fn memory_at(&self, index: u32) -> Option<MemoryType>
Gets the type of a memory at the given memory index.
Returns None
if the type index is out of bounds or the type has not
been parsed yet.
sourcepub fn global_at(&self, index: u32) -> Option<GlobalType>
pub fn global_at(&self, index: u32) -> Option<GlobalType>
Gets the type of a global at the given global index.
Returns None
if the type index is out of bounds or the type has not
been parsed yet.
sourcepub fn tag_at(&self, index: u32) -> Option<&'a FuncType>
pub fn tag_at(&self, index: u32) -> Option<&'a FuncType>
Gets the type of a tag at the given tag index.
Returns None
if the type index is out of bounds or the type has not
been parsed yet.
sourcepub fn function_at(&self, index: u32) -> Option<&'a FuncType>
pub fn function_at(&self, index: u32) -> Option<&'a FuncType>
Gets the type of a core function at the given function index.
Returns None
if the type index is out of bounds or the type has not
been parsed yet.
sourcepub fn element_at(&self, index: u32) -> Option<RefType>
pub fn element_at(&self, index: u32) -> Option<RefType>
Gets the type of an element segment at the given element segment index.
Returns None
if the type index is out of bounds or the type has not
been parsed yet.
sourcepub fn component_function_at(&self, index: u32) -> Option<&'a ComponentFuncType>
pub fn component_function_at(&self, index: u32) -> Option<&'a ComponentFuncType>
Gets the type of a component function at the given function index.
Returns None
if the type index is out of bounds or the type has not
been parsed yet.
sourcepub fn module_at(&self, index: u32) -> Option<&'a ModuleType>
pub fn module_at(&self, index: u32) -> Option<&'a ModuleType>
Gets the type of a module at the given module index.
Returns None
if the type index is out of bounds or the type has not
been parsed yet.
sourcepub fn instance_at(&self, index: u32) -> Option<&'a InstanceType>
pub fn instance_at(&self, index: u32) -> Option<&'a InstanceType>
Gets the type of a module instance at the given module instance index.
Returns None
if the type index is out of bounds or the type has not
been parsed yet.
sourcepub fn component_at(&self, index: u32) -> Option<&'a ComponentType>
pub fn component_at(&self, index: u32) -> Option<&'a ComponentType>
Gets the type of a component at the given component index.
Returns None
if the type index is out of bounds or the type has not
been parsed yet.
sourcepub fn component_instance_at(
&self,
index: u32,
) -> Option<&'a ComponentInstanceType>
pub fn component_instance_at( &self, index: u32, ) -> Option<&'a ComponentInstanceType>
Gets the type of an component instance at the given component instance index.
Returns None
if the type index is out of bounds or the type has not
been parsed yet.
sourcepub fn value_at(&self, index: u32) -> Option<ComponentValType>
pub fn value_at(&self, index: u32) -> Option<ComponentValType>
Gets the type of a value at the given value index.
Returns None
if the type index is out of bounds or the type has not
been parsed yet.
sourcepub fn entity_type_from_import(&self, import: &Import<'_>) -> Option<EntityType>
pub fn entity_type_from_import(&self, import: &Import<'_>) -> Option<EntityType>
Gets the entity type for the given import.
sourcepub fn entity_type_from_export(&self, export: &Export<'_>) -> Option<EntityType>
pub fn entity_type_from_export(&self, export: &Export<'_>) -> Option<EntityType>
Gets the entity type from the given export.
sourcepub fn component_entity_type_of_extern(
&self,
name: &str,
) -> Option<ComponentEntityType>
pub fn component_entity_type_of_extern( &self, name: &str, ) -> Option<ComponentEntityType>
Gets the component entity type for the given component import.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for TypesRef<'a>
impl<'a> RefUnwindSafe for TypesRef<'a>
impl<'a> Send for TypesRef<'a>
impl<'a> Sync for TypesRef<'a>
impl<'a> Unpin for TypesRef<'a>
impl<'a> UnwindSafe for TypesRef<'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> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)