pub struct ModuleTypes { /* private fields */ }
Expand description
All types used in a core wasm module.
Note that accessing this type is primarily done through the Index
implementations for this type.
Implementations§
source§impl ModuleTypes
impl ModuleTypes
sourcepub fn wasm_types(
&self,
) -> impl ExactSizeIterator<Item = (ModuleInternedTypeIndex, &WasmSubType)>
pub fn wasm_types( &self, ) -> impl ExactSizeIterator<Item = (ModuleInternedTypeIndex, &WasmSubType)>
Returns an iterator over all the wasm function signatures found within this module.
sourcepub fn get(&self, ty: ModuleInternedTypeIndex) -> Option<&WasmSubType>
pub fn get(&self, ty: ModuleInternedTypeIndex) -> Option<&WasmSubType>
Get the type at the specified index, if it exists.
sourcepub fn rec_groups(
&self,
) -> impl ExactSizeIterator<Item = (ModuleInternedRecGroupIndex, Range<ModuleInternedTypeIndex>)> + '_
pub fn rec_groups( &self, ) -> impl ExactSizeIterator<Item = (ModuleInternedRecGroupIndex, Range<ModuleInternedTypeIndex>)> + '_
Get an iterator over all recursion groups defined in this module and their elements.
sourcepub fn rec_group_elements(
&self,
rec_group: ModuleInternedRecGroupIndex,
) -> impl ExactSizeIterator<Item = ModuleInternedTypeIndex>
pub fn rec_group_elements( &self, rec_group: ModuleInternedRecGroupIndex, ) -> impl ExactSizeIterator<Item = ModuleInternedTypeIndex>
Get the elements within an already-defined rec group.
sourcepub fn push(&mut self, ty: WasmSubType) -> ModuleInternedTypeIndex
pub fn push(&mut self, ty: WasmSubType) -> ModuleInternedTypeIndex
Adds a new type to this interned list of types.
sourcepub fn trampoline_types(
&self,
) -> impl Iterator<Item = (ModuleInternedTypeIndex, ModuleInternedTypeIndex)> + '_
pub fn trampoline_types( &self, ) -> impl Iterator<Item = (ModuleInternedTypeIndex, ModuleInternedTypeIndex)> + '_
Iterate over the trampoline function types that this module requires.
Yields pairs of (1) a function type and (2) its associated trampoline type. They might be the same.
See the docs for WasmFuncType::trampoline_type
for details on
trampoline types.
sourcepub fn trampoline_type(
&self,
ty: ModuleInternedTypeIndex,
) -> ModuleInternedTypeIndex
pub fn trampoline_type( &self, ty: ModuleInternedTypeIndex, ) -> ModuleInternedTypeIndex
Get the trampoline type for the given function type.
See the docs for WasmFuncType::trampoline_type
for details on
trampoline types.
source§impl ModuleTypes
impl ModuleTypes
Methods that only exist for ModuleTypesBuilder
.
sourcepub fn set_trampoline_type(
&mut self,
for_ty: ModuleInternedTypeIndex,
trampoline_ty: ModuleInternedTypeIndex,
)
pub fn set_trampoline_type( &mut self, for_ty: ModuleInternedTypeIndex, trampoline_ty: ModuleInternedTypeIndex, )
Associate trampoline_ty
as the trampoline type for for_ty
.
This is really only for use by the ModuleTypesBuilder
.
sourcepub fn push_rec_group(
&mut self,
range: Range<ModuleInternedTypeIndex>,
) -> ModuleInternedRecGroupIndex
pub fn push_rec_group( &mut self, range: Range<ModuleInternedTypeIndex>, ) -> ModuleInternedRecGroupIndex
Adds a new rec group to this interned list of types.
sourcepub fn next_rec_group(&self) -> ModuleInternedRecGroupIndex
pub fn next_rec_group(&self) -> ModuleInternedRecGroupIndex
Returns the next return value of push_rec_group
.
sourcepub fn next_ty(&self) -> ModuleInternedTypeIndex
pub fn next_ty(&self) -> ModuleInternedTypeIndex
Returns the next return value of push
.
Trait Implementations§
source§impl Default for ModuleTypes
impl Default for ModuleTypes
source§fn default() -> ModuleTypes
fn default() -> ModuleTypes
source§impl<'de> Deserialize<'de> for ModuleTypes
impl<'de> Deserialize<'de> for ModuleTypes
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl Index<ModuleInternedTypeIndex> for ModuleTypes
impl Index<ModuleInternedTypeIndex> for ModuleTypes
source§type Output = WasmSubType
type Output = WasmSubType
source§fn index(&self, sig: ModuleInternedTypeIndex) -> &WasmSubType
fn index(&self, sig: ModuleInternedTypeIndex) -> &WasmSubType
container[index]
) operation. Read more