Struct wasm_encoder::ModuleType
source · pub struct ModuleType { /* private fields */ }
Expand description
Represents the type of a core module.
Implementations§
source§impl ModuleType
impl ModuleType
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 ty(&mut self) -> CoreTypeEncoder<'_>
pub fn ty(&mut self) -> CoreTypeEncoder<'_>
Define a type in this module type.
The returned encoder must be used before adding another definition.
sourcepub fn alias_outer_core_type(&mut self, count: u32, index: u32) -> &mut Self
pub fn alias_outer_core_type(&mut self, count: u32, index: u32) -> &mut Self
Defines an outer core type alias 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§
source§impl Clone for ModuleType
impl Clone for ModuleType
source§fn clone(&self) -> ModuleType
fn clone(&self) -> ModuleType
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ModuleType
impl Debug for ModuleType
source§impl Default for ModuleType
impl Default for ModuleType
source§fn default() -> ModuleType
fn default() -> ModuleType
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ModuleType
impl RefUnwindSafe for ModuleType
impl Send for ModuleType
impl Sync for ModuleType
impl Unpin for ModuleType
impl UnwindSafe for ModuleType
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)