pub enum VariantBody {
Unit,
Other,
Newtype(Box<WireSchema>),
Tuple(Vec<WireSchema>),
Struct(Vec<WireField>),
}Expand description
The payload one variant carries.
Variants§
Unit
Other
A #[serde(other)] unit variant: the decode fallback for a variant name
this build does not know. It is wire-relevant on its own, because
removing it turns a forward-compatible decode into a hard failure.
Newtype(Box<WireSchema>)
Tuple(Vec<WireSchema>)
Struct(Vec<WireField>)
Implementations§
Source§impl VariantBody
impl VariantBody
Sourcepub fn newtype(inner: WireSchema) -> Self
pub fn newtype(inner: WireSchema) -> Self
A newtype variant body.
Sourcepub fn structure(fields: impl IntoIterator<Item = WireField>) -> Self
pub fn structure(fields: impl IntoIterator<Item = WireField>) -> Self
A struct variant body, normalized into field-name order.
Trait Implementations§
Source§impl Clone for VariantBody
impl Clone for VariantBody
Source§fn clone(&self) -> VariantBody
fn clone(&self) -> VariantBody
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VariantBody
impl Debug for VariantBody
impl Eq for VariantBody
Source§impl PartialEq for VariantBody
impl PartialEq for VariantBody
impl StructuralPartialEq for VariantBody
Auto Trait Implementations§
impl Freeze for VariantBody
impl RefUnwindSafe for VariantBody
impl Send for VariantBody
impl Sync for VariantBody
impl Unpin for VariantBody
impl UnsafeUnpin for VariantBody
impl UnwindSafe for VariantBody
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