pub struct VariantPart<'input> { /* private fields */ }
Expand description
A variant part.
A variant part is a discriminant member and list of variants that are selected based on the value of the discriminant member.
Implementations§
Source§impl<'input> VariantPart<'input>
impl<'input> VariantPart<'input>
Sourcepub fn discriminant<'a>(
&self,
members: &'a [Member<'input>],
) -> Option<&'a Member<'input>>
pub fn discriminant<'a>( &self, members: &'a [Member<'input>], ) -> Option<&'a Member<'input>>
The discriminant member for this variant part.
The given members should be from the type containing this variant part.
Sourcepub fn bit_offset(&self) -> u64
pub fn bit_offset(&self) -> u64
The smallest offset in bits for a variant of this variant part.
Trait Implementations§
Source§impl<'input> Clone for VariantPart<'input>
impl<'input> Clone for VariantPart<'input>
Source§fn clone(&self) -> VariantPart<'input>
fn clone(&self) -> VariantPart<'input>
Returns a copy 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<'input> Debug for VariantPart<'input>
impl<'input> Debug for VariantPart<'input>
Source§impl<'input> Default for VariantPart<'input>
impl<'input> Default for VariantPart<'input>
Source§fn default() -> VariantPart<'input>
fn default() -> VariantPart<'input>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<'input> Freeze for VariantPart<'input>
impl<'input> RefUnwindSafe for VariantPart<'input>
impl<'input> Send for VariantPart<'input>
impl<'input> Sync for VariantPart<'input>
impl<'input> Unpin for VariantPart<'input>
impl<'input> UnwindSafe for VariantPart<'input>
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