pub struct ComponentFuncTypeEncoder<'a> { /* private fields */ }
Expand description
Used to encode component function types.
Implementations§
Source§impl<'a> ComponentFuncTypeEncoder<'a>
impl<'a> ComponentFuncTypeEncoder<'a>
Sourcepub fn params<'b, P, T>(&mut self, params: P) -> &mut Selfwhere
P: IntoIterator<Item = (&'b str, T)>,
P::IntoIter: ExactSizeIterator,
T: Into<ComponentValType>,
Available on crate feature component-model
only.
pub fn params<'b, P, T>(&mut self, params: P) -> &mut Selfwhere
P: IntoIterator<Item = (&'b str, T)>,
P::IntoIter: ExactSizeIterator,
T: Into<ComponentValType>,
component-model
only.Defines named parameters.
Parameters must be defined before defining results.
§Panics
This method will panic if the function is called twice since parameters can only be encoded once.
Sourcepub fn result(&mut self, ty: Option<ComponentValType>) -> &mut Self
Available on crate feature component-model
only.
pub fn result(&mut self, ty: Option<ComponentValType>) -> &mut Self
component-model
only.Defines a single unnamed result.
This method cannot be used with results
.
§Panics
This method will panic if the function is called twice, called before
the params
method, or called in addition to the results
method.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ComponentFuncTypeEncoder<'a>
impl<'a> RefUnwindSafe for ComponentFuncTypeEncoder<'a>
impl<'a> Send for ComponentFuncTypeEncoder<'a>
impl<'a> Sync for ComponentFuncTypeEncoder<'a>
impl<'a> Unpin for ComponentFuncTypeEncoder<'a>
impl<'a> !UnwindSafe for ComponentFuncTypeEncoder<'a>
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