pub struct Variant<'a, F: Deref<Target = [Field<'a>]> = &'a [Field<'a>]> {
pub name: &'a str,
pub discriminant: MaybeUninhabited<Discriminant<'a>>,
pub fields: F,
}
Expand description
Description of the shallow layout of a variant
Fields§
§name: &'a str
The variant’s name.
discriminant: MaybeUninhabited<Discriminant<'a>>
The variant’s descriminant, iff the variant is inhabited.
fields: F
The variant’s fields.
Trait Implementations§
Source§impl<'de: 'a, 'a, F> Deserialize<'de> for Variant<'a, F>
impl<'de: 'a, 'a, F> Deserialize<'de> for Variant<'a, F>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a, F: Ord + Deref<Target = [Field<'a>]>> Ord for Variant<'a, F>
impl<'a, F: Ord + Deref<Target = [Field<'a>]>> Ord for Variant<'a, F>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'a, F: PartialOrd + Deref<Target = [Field<'a>]>> PartialOrd for Variant<'a, F>
impl<'a, F: PartialOrd + Deref<Target = [Field<'a>]>> PartialOrd for Variant<'a, F>
impl<'a, F: Copy + Deref<Target = [Field<'a>]>> Copy for Variant<'a, F>
impl<'a, F: Eq + Deref<Target = [Field<'a>]>> Eq for Variant<'a, F>
impl<'a, F: Deref<Target = [Field<'a>]>> StructuralPartialEq for Variant<'a, F>
Auto Trait Implementations§
impl<'a, F> Freeze for Variant<'a, F>where
F: Freeze,
impl<'a, F> RefUnwindSafe for Variant<'a, F>where
F: RefUnwindSafe,
impl<'a, F> Send for Variant<'a, F>where
F: Send,
impl<'a, F> Sync for Variant<'a, F>where
F: Sync,
impl<'a, F> Unpin for Variant<'a, F>where
F: Unpin,
impl<'a, F> UnwindSafe for Variant<'a, F>where
F: 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