Enum proc_easy::ReferenceExpr
source · [−]Expand description
Expression that may be a constant or a reference to member field. Often used pattern is having attribute that refer to a field or constant expression.
Examples
/// Peeking first `const` token it decides to parse `Expr` variant.
let re: ReferenceExpr = parse_quote!(const 42);
assert_eq!(re, ReferenceExpr::Expr { const_: parse_quote!(const), expr: parse_quote!(42) });/// Without `const` token it decides to parse `Member` variant.
let re: ReferenceExpr = parse_quote!(foo);
assert_eq!(re, ReferenceExpr::Member { ident: format_ident!("foo") });Variants
Member
Fields
ident: IdentMember ident.
Expr
Constant expression
Trait Implementations
sourceimpl Debug for ReferenceExpr
impl Debug for ReferenceExpr
sourceimpl EasyPeek for ReferenceExpr
impl EasyPeek for ReferenceExpr
sourcefn peek(lookahead1: &Lookahead1<'_>) -> bool
fn peek(lookahead1: &Lookahead1<'_>) -> bool
Peek head token before parsing.
sourcefn peek_stream(stream: ParseStream<'_>) -> bool
fn peek_stream(stream: ParseStream<'_>) -> bool
Peek head token before parsing.
sourceimpl Parse for ReferenceExpr
impl Parse for ReferenceExpr
fn parse(input: ParseStream<'_>) -> Result<Self>
sourceimpl PartialEq<ReferenceExpr> for ReferenceExpr
impl PartialEq<ReferenceExpr> for ReferenceExpr
sourcefn eq(&self, other: &ReferenceExpr) -> bool
fn eq(&self, other: &ReferenceExpr) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &ReferenceExpr) -> bool
fn ne(&self, other: &ReferenceExpr) -> bool
This method tests for !=.
impl Eq for ReferenceExpr
impl StructuralEq for ReferenceExpr
impl StructuralPartialEq for ReferenceExpr
Auto Trait Implementations
impl RefUnwindSafe for ReferenceExpr
impl !Send for ReferenceExpr
impl !Sync for ReferenceExpr
impl Unpin for ReferenceExpr
impl UnwindSafe for ReferenceExpr
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more