pub struct ComponentFuncTypeEncoder<'a> { /* private fields */ }
Available on crate feature
component-model
only.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>,
pub fn params<'b, P, T>(&mut self, params: P) -> &mut Selfwhere
P: IntoIterator<Item = (&'b str, T)>,
P::IntoIter: ExactSizeIterator,
T: Into<ComponentValType>,
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: impl Into<ComponentValType>) -> &mut Self
pub fn result(&mut self, ty: impl Into<ComponentValType>) -> &mut Self
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.
sourcepub fn results<'b, R, T>(&mut self, results: R) -> &mut Selfwhere
R: IntoIterator<Item = (&'b str, T)>,
R::IntoIter: ExactSizeIterator,
T: Into<ComponentValType>,
pub fn results<'b, R, T>(&mut self, results: R) -> &mut Selfwhere
R: IntoIterator<Item = (&'b str, T)>,
R::IntoIter: ExactSizeIterator,
T: Into<ComponentValType>,
Defines named results.
This method cannot be used with result
.
§Panics
This method will panic if the function is called twice, called before
the params
method, or called in addition to the result
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