pub struct VariantSchema<Id = SchemaHash> {
pub name: String,
pub index: u32,
pub payload: VariantPayload<Id>,
}Expand description
Describes a single variant in an enum.
Fields§
§name: String§index: u32§payload: VariantPayload<Id>Implementations§
Source§impl<Id> VariantSchema<Id>
impl<Id> VariantSchema<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 variant.
Sourcepub fn try_map_type_refs<OtherId, E>(
self,
f: &mut impl FnMut(TypeRef<Id>) -> Result<TypeRef<OtherId>, E>,
) -> Result<VariantSchema<OtherId>, E>
pub fn try_map_type_refs<OtherId, E>( self, f: &mut impl FnMut(TypeRef<Id>) -> Result<TypeRef<OtherId>, E>, ) -> Result<VariantSchema<OtherId>, E>
Transform every TypeRef in this variant.
Trait Implementations§
Source§impl<Id: Clone> Clone for VariantSchema<Id>
impl<Id: Clone> Clone for VariantSchema<Id>
Source§fn clone(&self) -> VariantSchema<Id>
fn clone(&self) -> VariantSchema<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> Debug for VariantSchema<Id>
impl<Id: Debug> Debug for VariantSchema<Id>
Auto Trait Implementations§
impl<Id> Freeze for VariantSchema<Id>where
Id: Freeze,
impl<Id> RefUnwindSafe for VariantSchema<Id>where
Id: RefUnwindSafe,
impl<Id> Send for VariantSchema<Id>where
Id: Send,
impl<Id> Sync for VariantSchema<Id>where
Id: Sync,
impl<Id> Unpin for VariantSchema<Id>where
Id: Unpin,
impl<Id> UnsafeUnpin for VariantSchema<Id>where
Id: UnsafeUnpin,
impl<Id> UnwindSafe for VariantSchema<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