Struct Types
pub struct Types { /* private fields */ }
Expand description
Represents the types known to a crate::Validator
once validation has completed.
The type information is returned via the crate::Validator::end
method.
Implementations§
§impl Types
impl Types
pub fn component_any_type_at(&self, index: u32) -> ComponentAnyTypeId
pub fn component_any_type_at(&self, index: u32) -> ComponentAnyTypeId
Gets a component WebAssembly type at the given type index.
Note that this is in contrast to TypesRef::core_type_at_in_component
which gets a core type from its index.
§Panics
Panics if index
is not a valid type index.
pub fn component_type_at(&self, index: u32) -> ComponentTypeId
pub fn component_type_at(&self, index: u32) -> ComponentTypeId
Gets a component type at the given type index.
§Panics
Panics if index
is not a valid component type index.
pub fn component_defined_type_at(&self, index: u32) -> ComponentDefinedTypeId
pub fn component_defined_type_at(&self, index: u32) -> ComponentDefinedTypeId
Gets a component type from the given component type index.
§Panics
Panics if index
is not a valid defined type index or if this type
information represents a core module.
pub fn component_function_at(&self, index: u32) -> ComponentFuncTypeId
pub fn component_function_at(&self, index: u32) -> ComponentFuncTypeId
Gets the type of a component function at the given function index.
§Panics
This will panic if the index
provided is out of bounds or if this type
information represents a core module.
pub fn component_function_count(&self) -> u32
pub fn component_function_count(&self) -> u32
Gets the count of imported, exported, or aliased component functions.
pub fn module_at(&self, index: u32) -> ComponentCoreModuleTypeId
pub fn module_at(&self, index: u32) -> ComponentCoreModuleTypeId
Gets the type of a module at the given module index.
§Panics
This will panic if the index
provided is out of bounds or if this type
information represents a core module.
pub fn module_count(&self) -> usize
pub fn module_count(&self) -> usize
Gets the count of imported, exported, or aliased modules.
pub fn core_instance_at(&self, index: u32) -> ComponentCoreInstanceTypeId
pub fn core_instance_at(&self, index: u32) -> ComponentCoreInstanceTypeId
Gets the type of a module instance at the given module instance index.
§Panics
This will panic if the index
provided is out of bounds or if this type
information represents a core module.
pub fn core_instance_count(&self) -> usize
pub fn core_instance_count(&self) -> usize
Gets the count of imported, exported, or aliased core module instances.
pub fn component_at(&self, index: u32) -> ComponentTypeId
pub fn component_at(&self, index: u32) -> ComponentTypeId
Gets the type of a component at the given component index.
§Panics
This will panic if the index
provided is out of bounds or if this type
information represents a core module.
pub fn component_count(&self) -> usize
pub fn component_count(&self) -> usize
Gets the count of imported, exported, or aliased components.
pub fn component_instance_at(&self, index: u32) -> ComponentInstanceTypeId
pub fn component_instance_at(&self, index: u32) -> ComponentInstanceTypeId
Gets the type of an component instance at the given component instance index.
§Panics
This will panic if the index
provided is out of bounds or if this type
information represents a core module.
pub fn component_instance_count(&self) -> usize
pub fn component_instance_count(&self) -> usize
Gets the count of imported, exported, or aliased component instances.
pub fn value_at(&self, index: u32) -> ComponentValType
pub fn value_at(&self, index: u32) -> ComponentValType
Gets the type of a value at the given value index.
§Panics
This will panic if the index
provided is out of bounds or if this type
information represents a core module.
pub fn value_count(&self) -> usize
pub fn value_count(&self) -> usize
Gets the count of imported, exported, or aliased values.
pub fn component_entity_type_of_import(
&self,
name: &str,
) -> Option<ComponentEntityType>
pub fn component_entity_type_of_import( &self, name: &str, ) -> Option<ComponentEntityType>
Gets the component entity type for the given component import name.
pub fn component_entity_type_of_export(
&self,
name: &str,
) -> Option<ComponentEntityType>
pub fn component_entity_type_of_export( &self, name: &str, ) -> Option<ComponentEntityType>
Gets the component entity type for the given component export name.
pub fn peel_alias<T>(&self, ty: T) -> Option<T>where
T: Aliasable,
pub fn peel_alias<T>(&self, ty: T) -> Option<T>where
T: Aliasable,
Attempts to lookup the type id that ty
is an alias of.
Returns None
if ty
wasn’t listed as aliasing a prior type.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Types
impl RefUnwindSafe for Types
impl Send for Types
impl Sync for Types
impl Unpin for Types
impl UnwindSafe for Types
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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