[−][src]Struct walrus::ModuleTypes
The set of de-duplicated types within a module.
Methods
impl ModuleTypes
[src]
pub fn get(&self, id: TypeId) -> &Type
[src]
Get a type associated with an ID
pub fn get_mut(&mut self, id: TypeId) -> &mut Type
[src]
Get a type associated with an ID
pub fn params_results(&self, id: TypeId) -> (&[ValType], &[ValType])
[src]
Get the parameters and results for the given type.
pub fn params(&self, id: TypeId) -> &[ValType]
[src]
Get the parameters for the given type.
pub fn results(&self, id: TypeId) -> &[ValType]
[src]
Get the results for the given type.
pub fn by_name(&self, name: &str) -> Option<TypeId>
[src]
Get a type ID by its name.
This is currently only intended for in-memory modifications, and by
default will always return None
for a newly parsed module. A
hypothetical future WAT text format to walrus::Module
parser could
preserve type names from the WAT.
pub fn iter(&self) -> impl Iterator<Item = &Type>
[src]
Get a shared reference to this module's types.
pub fn delete(&mut self, ty: TypeId)
[src]
Removes a type from this module.
It is up to you to ensure that any potential references to the deleted
type are also removed, eg call_indirect
expressions, function types,
etc.
pub fn add(&mut self, params: &[ValType], results: &[ValType]) -> TypeId
[src]
Add a new type to this module, and return its Id
pub fn find(&self, params: &[ValType], results: &[ValType]) -> Option<TypeId>
[src]
Find the existing type for the given parameters and results.
Trait Implementations
Auto Trait Implementations
impl Sync for ModuleTypes
impl Unpin for ModuleTypes
impl Send for ModuleTypes
impl UnwindSafe for ModuleTypes
impl RefUnwindSafe for ModuleTypes
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,