pub struct ComponentDefinedTypeEncoder<'a>(_);
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 tuple<I, T>(self, types: I)where
I: IntoIterator<Item = T>,
I::IntoIter: ExactSizeIterator,
T: Into<ComponentValType>,
pub fn tuple<I, T>(self, types: I)where I: IntoIterator<Item = T>, I::IntoIter: ExactSizeIterator, T: Into<ComponentValType>,
Define a tuple type.
sourcepub fn flags<'a, I>(self, names: I)where
I: IntoIterator<Item = &'a str>,
I::IntoIter: ExactSizeIterator,
pub fn flags<'a, I>(self, names: I)where I: IntoIterator<Item = &'a str>, I::IntoIter: ExactSizeIterator,
Define a flags type.
sourcepub fn enum_type<'a, I>(self, tags: I)where
I: IntoIterator<Item = &'a str>,
I::IntoIter: ExactSizeIterator,
pub fn enum_type<'a, I>(self, tags: I)where I: IntoIterator<Item = &'a str>, I::IntoIter: ExactSizeIterator,
Define an enum type.
sourcepub fn union<I, T>(self, types: I)where
I: IntoIterator<Item = T>,
I::IntoIter: ExactSizeIterator,
T: Into<ComponentValType>,
pub fn union<I, T>(self, types: I)where I: IntoIterator<Item = T>, I::IntoIter: ExactSizeIterator, T: Into<ComponentValType>,
Define a union 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> 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