pub struct ComponentDefinedTypeEncoder<'a>(/* private fields */);
Available on crate feature
component-model
only.Expand description
Used for encoding component defined types.
Implementations§
source§impl ComponentDefinedTypeEncoder<'_>
impl ComponentDefinedTypeEncoder<'_>
sourcepub fn primitive(self, ty: PrimitiveValType)
pub fn primitive(self, ty: PrimitiveValType)
Define a primitive value type.
sourcepub fn record<'a, F, T>(self, fields: F)where
F: IntoIterator<Item = (&'a str, T)>,
F::IntoIter: ExactSizeIterator,
T: Into<ComponentValType>,
pub fn record<'a, F, T>(self, fields: F)where
F: IntoIterator<Item = (&'a str, T)>,
F::IntoIter: ExactSizeIterator,
T: Into<ComponentValType>,
Define a record type.
sourcepub fn variant<'a, C>(self, cases: C)where
C: IntoIterator<Item = (&'a str, Option<ComponentValType>, Option<u32>)>,
C::IntoIter: ExactSizeIterator,
pub fn variant<'a, C>(self, cases: C)where
C: IntoIterator<Item = (&'a str, Option<ComponentValType>, Option<u32>)>,
C::IntoIter: ExactSizeIterator,
Define a variant type.
sourcepub fn list(self, ty: impl Into<ComponentValType>)
pub fn list(self, ty: impl Into<ComponentValType>)
Define a list type.
sourcepub fn option(self, ty: impl Into<ComponentValType>)
pub fn option(self, ty: impl Into<ComponentValType>)
Define an option type.
sourcepub fn result(self, ok: Option<ComponentValType>, err: Option<ComponentValType>)
pub fn result(self, ok: Option<ComponentValType>, err: Option<ComponentValType>)
Define a result type.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ComponentDefinedTypeEncoder<'a>
impl<'a> RefUnwindSafe for ComponentDefinedTypeEncoder<'a>
impl<'a> Send for ComponentDefinedTypeEncoder<'a>
impl<'a> Sync for ComponentDefinedTypeEncoder<'a>
impl<'a> Unpin for ComponentDefinedTypeEncoder<'a>
impl<'a> !UnwindSafe for ComponentDefinedTypeEncoder<'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