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.