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