Struct wasm_encoder::adapter::TypeSection
source · [−]pub struct TypeSection { /* private fields */ }
Expand description
An encoder for the adapter module type section.
Example
use wasm_encoder::adapter::{AdapterModule, TypeSection};
let mut types = TypeSection::new();
types.function(&[], &[]);
let mut module = AdapterModule::new();
module.section(&types);
let bytes = module.finish();
Implementations
sourceimpl TypeSection
impl TypeSection
sourcepub fn instance(&mut self, ty: &InstanceType) -> &mut Self
pub fn instance(&mut self, ty: &InstanceType) -> &mut Self
Define an instance type in this type section.
sourcepub fn module(&mut self, ty: &ModuleType) -> &mut Self
pub fn module(&mut self, ty: &ModuleType) -> &mut Self
Define a module type in this type section.
Trait Implementations
sourceimpl AdapterModuleSection for TypeSection
impl AdapterModuleSection for TypeSection
sourceimpl Clone for TypeSection
impl Clone for TypeSection
sourcefn clone(&self) -> TypeSection
fn clone(&self) -> TypeSection
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 TypeSection
impl Debug for TypeSection
sourceimpl Default for TypeSection
impl Default for TypeSection
sourcefn default() -> TypeSection
fn default() -> TypeSection
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for TypeSection
impl Send for TypeSection
impl Sync for TypeSection
impl Unpin for TypeSection
impl UnwindSafe for TypeSection
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub 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.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub 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