Struct wasm_encoder::ModuleType
source · [−]pub struct ModuleType { /* private fields */ }
Expand description
Represents a module type.
Implementations
sourceimpl ModuleType
impl ModuleType
sourcepub fn function<P, R>(&mut self, params: P, results: R) -> &mut Self where
P: IntoIterator<Item = ValType>,
P::IntoIter: ExactSizeIterator,
R: IntoIterator<Item = ValType>,
R::IntoIter: ExactSizeIterator,
pub fn function<P, R>(&mut self, params: P, results: R) -> &mut Self where
P: IntoIterator<Item = ValType>,
P::IntoIter: ExactSizeIterator,
R: IntoIterator<Item = ValType>,
R::IntoIter: ExactSizeIterator,
Define a function in this module type.
sourcepub fn import(&mut self, module: &str, name: &str, ty: EntityType) -> &mut Self
pub fn import(&mut self, module: &str, name: &str, ty: EntityType) -> &mut Self
Defines an import in this module type.
sourcepub fn export(&mut self, name: &str, ty: EntityType) -> &mut Self
pub fn export(&mut self, name: &str, ty: EntityType) -> &mut Self
Defines an export in this module type.
sourcepub fn type_count(&self) -> u32
pub fn type_count(&self) -> u32
Gets the number of types that have been added to this module type.
Trait Implementations
sourceimpl Clone for ModuleType
impl Clone for ModuleType
sourcefn clone(&self) -> ModuleType
fn clone(&self) -> ModuleType
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ModuleType
impl Debug for ModuleType
sourceimpl Default for ModuleType
impl Default for ModuleType
sourcefn default() -> ModuleType
fn default() -> ModuleType
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for ModuleType
impl Send for ModuleType
impl Sync for ModuleType
impl Unpin for ModuleType
impl UnwindSafe for ModuleType
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more