Struct wasmtime_environ::ModuleTypes
source · pub struct ModuleTypes { /* private fields */ }
Expand description
All types used in a core wasm module.
At this time this only contains function types. Note, though, that function
types are deduplicated within this ModuleTypes
.
Note that accesing 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 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
Returns the “default value” for a type. Read more
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Index<ModuleInternedTypeIndex> for ModuleTypes
impl Index<ModuleInternedTypeIndex> for ModuleTypes
§type Output = WasmSubType
type Output = WasmSubType
The returned type after indexing.
source§fn index(&self, sig: ModuleInternedTypeIndex) -> &WasmSubType
fn index(&self, sig: ModuleInternedTypeIndex) -> &WasmSubType
Performs the indexing (
container[index]
) operation. Read moreAuto Trait Implementations§
impl Freeze for ModuleTypes
impl RefUnwindSafe for ModuleTypes
impl Send for ModuleTypes
impl Sync for ModuleTypes
impl Unpin for ModuleTypes
impl UnwindSafe for ModuleTypes
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
Mutably borrows from an owned value. Read more