pub enum FieldOrVariant<'a> {
Field(&'a Field),
Variant(&'a Variant),
}
Expand description
Enum to encapsulate either a field from a struct or a variant from an enum.
Variants§
Field(&'a Field)
Represents a field within a struct or union.
Variant(&'a Variant)
Represents a variant within an enum.
Implementations§
Source§impl FieldOrVariant<'_>
impl FieldOrVariant<'_>
Sourcepub fn vis(&self) -> Option<&Visibility>
pub fn vis(&self) -> Option<&Visibility>
Returns a reference to the visibility of the item.
Sourcepub fn mutability(&self) -> Option<&FieldMutability>
pub fn mutability(&self) -> Option<&FieldMutability>
Returns a reference to the mutability of the item.
Sourcepub fn discriminant(&self) -> Option<&(Eq, Expr)>
pub fn discriminant(&self) -> Option<&(Eq, Expr)>
Returns a reference to the discriminant of the item.
Trait Implementations§
Source§impl<'a> Clone for FieldOrVariant<'a>
impl<'a> Clone for FieldOrVariant<'a>
Source§fn clone(&self) -> FieldOrVariant<'a>
fn clone(&self) -> FieldOrVariant<'a>
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<'a> Debug for FieldOrVariant<'a>
impl<'a> Debug for FieldOrVariant<'a>
Source§impl<'a> From<&'a Field> for FieldOrVariant<'a>
impl<'a> From<&'a Field> for FieldOrVariant<'a>
Source§impl<'a> From<&'a Variant> for FieldOrVariant<'a>
impl<'a> From<&'a Variant> for FieldOrVariant<'a>
Source§impl<'a> PartialEq for FieldOrVariant<'a>
impl<'a> PartialEq for FieldOrVariant<'a>
Source§impl ToTokens for FieldOrVariant<'_>
impl ToTokens for FieldOrVariant<'_>
Source§fn to_tokens(&self, tokens: &mut TokenStream)
fn to_tokens(&self, tokens: &mut TokenStream)
Source§fn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
Source§fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
impl Copy for FieldOrVariant<'_>
impl<'a> StructuralPartialEq for FieldOrVariant<'a>
Auto Trait Implementations§
impl<'a> Freeze for FieldOrVariant<'a>
impl<'a> RefUnwindSafe for FieldOrVariant<'a>
impl<'a> !Send for FieldOrVariant<'a>
impl<'a> !Sync for FieldOrVariant<'a>
impl<'a> Unpin for FieldOrVariant<'a>
impl<'a> UnwindSafe for FieldOrVariant<'a>
Blanket Implementations§
Source§impl<S> AssignWithType for S
impl<S> AssignWithType for S
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Spanned for Twhere
T: Spanned + ?Sized,
impl<T> Spanned for Twhere
T: Spanned + ?Sized,
Source§fn span(&self) -> Span
fn span(&self) -> Span
Returns a
Span
covering the complete contents of this syntax tree
node, or Span::call_site()
if this node is empty.