Struct wasm_encoder::TypeEncoder
source · [−]pub struct TypeEncoder<'a>(_);
Expand description
Used to encode types.
Implementations
sourceimpl<'a> TypeEncoder<'a>
impl<'a> TypeEncoder<'a>
sourcepub fn module(self, ty: &ModuleType)
pub fn module(self, ty: &ModuleType)
Define a module type.
sourcepub fn component(self, ty: &ComponentType)
pub fn component(self, ty: &ComponentType)
Define a component type.
sourcepub fn instance(self, ty: &InstanceType)
pub fn instance(self, ty: &InstanceType)
Define an instance type.
sourcepub fn function<'b, P, T>(self, params: P, result: impl Into<InterfaceTypeRef>) where
P: IntoIterator<Item = (Option<&'b str>, T)>,
P::IntoIter: ExactSizeIterator,
T: Into<InterfaceTypeRef>,
pub fn function<'b, P, T>(self, params: P, result: impl Into<InterfaceTypeRef>) where
P: IntoIterator<Item = (Option<&'b str>, T)>,
P::IntoIter: ExactSizeIterator,
T: Into<InterfaceTypeRef>,
Define a function type.
sourcepub fn value(self, ty: impl Into<InterfaceTypeRef>)
pub fn value(self, ty: impl Into<InterfaceTypeRef>)
Define a value type.
sourcepub fn interface_type(self) -> InterfaceTypeEncoder<'a>
pub fn interface_type(self) -> InterfaceTypeEncoder<'a>
Define an interface type.
The returned encoder must be finished before adding another type.
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for TypeEncoder<'a>
impl<'a> Send for TypeEncoder<'a>
impl<'a> Sync for TypeEncoder<'a>
impl<'a> Unpin for TypeEncoder<'a>
impl<'a> !UnwindSafe for TypeEncoder<'a>
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