#[repr(u8)]pub enum VariantPayload<Id = SchemaHash> {
Unit,
Newtype {
type_ref: TypeRef<Id>,
},
Tuple {
types: Vec<TypeRef<Id>>,
},
Struct {
fields: Vec<FieldSchema<Id>>,
},
}Expand description
The payload of an enum variant.
Variants§
Implementations§
Source§impl<Id> VariantPayload<Id>
impl<Id> VariantPayload<Id>
Sourcepub fn for_each_type_ref(&self, f: &mut impl FnMut(&TypeRef<Id>))
pub fn for_each_type_ref(&self, f: &mut impl FnMut(&TypeRef<Id>))
Visit every TypeRef in this payload.
Sourcepub fn try_map_type_refs<OtherId, E>(
self,
f: &mut impl FnMut(TypeRef<Id>) -> Result<TypeRef<OtherId>, E>,
) -> Result<VariantPayload<OtherId>, E>
pub fn try_map_type_refs<OtherId, E>( self, f: &mut impl FnMut(TypeRef<Id>) -> Result<TypeRef<OtherId>, E>, ) -> Result<VariantPayload<OtherId>, E>
Transform every TypeRef in this payload.
Trait Implementations§
Source§impl<Id> Clone for VariantPayload<Id>where
Id: Clone,
impl<Id> Clone for VariantPayload<Id>where
Id: Clone,
Source§fn clone(&self) -> VariantPayload<Id>
fn clone(&self) -> VariantPayload<Id>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<Id> Debug for VariantPayload<Id>where
Id: Debug,
impl<Id> Debug for VariantPayload<Id>where
Id: Debug,
Auto Trait Implementations§
impl<Id> Freeze for VariantPayload<Id>where
Id: Freeze,
impl<Id> RefUnwindSafe for VariantPayload<Id>where
Id: RefUnwindSafe,
impl<Id> Send for VariantPayload<Id>where
Id: Send,
impl<Id> Sync for VariantPayload<Id>where
Id: Sync,
impl<Id> Unpin for VariantPayload<Id>where
Id: Unpin,
impl<Id> UnsafeUnpin for VariantPayload<Id>where
Id: UnsafeUnpin,
impl<Id> UnwindSafe for VariantPayload<Id>where
Id: UnwindSafe,
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