pub struct ComponentDefinedTypeEncoder<'a>(/* private fields */);
Expand description
Used for encoding component defined types.
Implementations§
Source§impl ComponentDefinedTypeEncoder<'_>
impl ComponentDefinedTypeEncoder<'_>
Sourcepub fn primitive(self, ty: PrimitiveValType)
Available on crate feature component-model
only.
pub fn primitive(self, ty: PrimitiveValType)
component-model
only.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>,
Available on crate feature component-model
only.
pub fn record<'a, F, T>(self, fields: F)where
F: IntoIterator<Item = (&'a str, T)>,
F::IntoIter: ExactSizeIterator,
T: Into<ComponentValType>,
component-model
only.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,
Available on crate feature component-model
only.
pub fn variant<'a, C>(self, cases: C)where
C: IntoIterator<Item = (&'a str, Option<ComponentValType>, Option<u32>)>,
C::IntoIter: ExactSizeIterator,
component-model
only.Define a variant type.
Sourcepub fn list(self, ty: impl Into<ComponentValType>)
Available on crate feature component-model
only.
pub fn list(self, ty: impl Into<ComponentValType>)
component-model
only.Define a list type.
Sourcepub fn fixed_size_list(self, ty: impl Into<ComponentValType>, elements: u32)
Available on crate feature component-model
only.
pub fn fixed_size_list(self, ty: impl Into<ComponentValType>, elements: u32)
component-model
only.Define a fixed size list type.
Sourcepub fn tuple<I, T>(self, types: I)
Available on crate feature component-model
only.
pub fn tuple<I, T>(self, types: I)
component-model
only.Define a tuple type.
Sourcepub fn flags<'a, I>(self, names: I)
Available on crate feature component-model
only.
pub fn flags<'a, I>(self, names: I)
component-model
only.Define a flags type.
Sourcepub fn enum_type<'a, I>(self, tags: I)
Available on crate feature component-model
only.
pub fn enum_type<'a, I>(self, tags: I)
component-model
only.Define an enum type.
Sourcepub fn option(self, ty: impl Into<ComponentValType>)
Available on crate feature component-model
only.
pub fn option(self, ty: impl Into<ComponentValType>)
component-model
only.Define an option type.
Sourcepub fn result(self, ok: Option<ComponentValType>, err: Option<ComponentValType>)
Available on crate feature component-model
only.
pub fn result(self, ok: Option<ComponentValType>, err: Option<ComponentValType>)
component-model
only.Define a result type.
Sourcepub fn own(self, idx: u32)
Available on crate feature component-model
only.
pub fn own(self, idx: u32)
component-model
only.Define a own
handle type
Sourcepub fn borrow(self, idx: u32)
Available on crate feature component-model
only.
pub fn borrow(self, idx: u32)
component-model
only.Define a borrow
handle type
Sourcepub fn future(self, payload: Option<ComponentValType>)
Available on crate feature component-model
only.
pub fn future(self, payload: Option<ComponentValType>)
component-model
only.Define a future
type with the specified payload.
Sourcepub fn stream(self, payload: Option<ComponentValType>)
Available on crate feature component-model
only.
pub fn stream(self, payload: Option<ComponentValType>)
component-model
only.Define a stream
type with the specified payload.
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