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 async_(&mut self, is_async: bool) -> &mut Self
Available on crate feature component-model only.
pub fn async_(&mut self, is_async: bool) -> &mut Self
component-model only.Indicates whether this is an async function or not.
If this function is not invoked then the function type will not be
async.
§Panics
This method will panic if parameters or results have already been encoded.
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