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