Skip to main content

ItemOrExpr

Enum ItemOrExpr 

Source
#[non_exhaustive]
pub enum ItemOrExpr { Item(Item), Expr(Expr), }
Expand description

Parsing an item or an expression.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Item(Item)

An item.

§

Expr(Expr)

An expression.

Trait Implementations§

Source§

impl Debug for ItemOrExpr

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for ItemOrExpr

Source§

impl Parse for ItemOrExpr

Source§

fn parse(p: &mut Parser<'_>) -> Result<Self, Error>

Parse the current item from the parser.
Source§

impl PartialEq for ItemOrExpr

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Peek for ItemOrExpr

Source§

fn peek(p: &mut Peeker<'_>) -> bool

Peek the parser for the given token.
Source§

impl StructuralPartialEq for ItemOrExpr

Source§

impl TryClone for ItemOrExpr

Source§

fn try_clone(&self) -> Result<Self>

Try to clone the current value, raising an allocation error if it’s unsuccessful.
Source§

fn try_clone_from(&mut self, source: &Self) -> Result<(), Error>

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl Forget for ItemOrExpr

§

impl Freeze for ItemOrExpr
where *const Attribute is !null: Freeze, PhantomData<Attribute>: Freeze, *const (PathSegmentExpr, Option<Comma>) is !null: Freeze, PhantomData<(PathSegmentExpr, Option<Comma>)>: Freeze, *const (ColonColon, PathSegment) is !null: Freeze, PhantomData<(ColonColon, PathSegment)>: Freeze, *const (ItemUsePath, Option<Comma>) is !null: Freeze, PhantomData<(ItemUsePath, Option<Comma>)>: Freeze, *const (ColonColon, ItemUseSegment) is !null: Freeze, PhantomData<(ColonColon, ItemUseSegment)>: Freeze, *const (FnArg, Option<Comma>) is !null: Freeze, PhantomData<(FnArg, Option<Comma>)>: Freeze, *const (Box<Type>, Option<Comma>) is !null: Freeze, PhantomData<(Box<Type>, Option<Comma>)>: Freeze, *const Stmt is !null: Freeze, PhantomData<Stmt>: Freeze, *const (ItemVariant, Option<Comma>) is !null: Freeze, PhantomData<(ItemVariant, Option<Comma>)>: Freeze, *const (Field, Option<Comma>) is !null: Freeze, PhantomData<(Field, Option<Comma>)>: Freeze, *const (ImplItem, Option<SemiColon>) is !null: Freeze, PhantomData<(ImplItem, Option<SemiColon>)>: Freeze, *const File is !null: Freeze, PhantomData<File>: Freeze, *const Expr is !null: Freeze, PhantomData<Expr>: Freeze, *const Condition is !null: Freeze, PhantomData<Condition>: Freeze, *const Block is !null: Freeze, PhantomData<Block>: Freeze, *const (Pat, Option<Comma>) is !null: Freeze, PhantomData<(Pat, Option<Comma>)>: Freeze, *const Pat is !null: Freeze, PhantomData<Pat>: Freeze, *const ExprElseIf is !null: Freeze, PhantomData<ExprElseIf>: Freeze, *const (ExprMatchBranch, Option<Comma>) is !null: Freeze, PhantomData<(ExprMatchBranch, Option<Comma>)>: Freeze, *const (Expr, Option<Comma>) is !null: Freeze, PhantomData<(Expr, Option<Comma>)>: Freeze, *const (ExprSelectBranch, Option<Comma>) is !null: Freeze, PhantomData<(ExprSelectBranch, Option<Comma>)>: Freeze, *const (FieldAssign, Option<Comma>) is !null: Freeze, PhantomData<(FieldAssign, Option<Comma>)>: Freeze, NonZero<u32>: Freeze, *const Token is !null: Freeze, PhantomData<Token>: Freeze,

§

impl Move for ItemOrExpr

§

impl RefUnwindSafe for ItemOrExpr

§

impl Send for ItemOrExpr
where Unique<Attribute>: Send, Unique<(PathSegmentExpr, Option<Comma>)>: Send, Unique<(ColonColon, PathSegment)>: Send, Unique<(ItemUsePath, Option<Comma>)>: Send, Unique<(ColonColon, ItemUseSegment)>: Send, Unique<(FnArg, Option<Comma>)>: Send, Unique<(Box<Type>, Option<Comma>)>: Send, Unique<Stmt>: Send, Unique<(ItemVariant, Option<Comma>)>: Send, Unique<(Field, Option<Comma>)>: Send, Unique<(ImplItem, Option<SemiColon>)>: Send, Unique<File>: Send, Unique<Expr>: Send, Unique<Condition>: Send, Unique<Block>: Send, Unique<(Pat, Option<Comma>)>: Send, Unique<Pat>: Send, Unique<ExprElseIf>: Send, Unique<(ExprMatchBranch, Option<Comma>)>: Send, Unique<(Expr, Option<Comma>)>: Send, Unique<(ExprSelectBranch, Option<Comma>)>: Send, Unique<(FieldAssign, Option<Comma>)>: Send, NonZero<u32>: Send, Unique<Token>: Send,

§

impl Sync for ItemOrExpr
where Unique<Attribute>: Sync, Unique<(PathSegmentExpr, Option<Comma>)>: Sync, Unique<(ColonColon, PathSegment)>: Sync, Unique<(ItemUsePath, Option<Comma>)>: Sync, Unique<(ColonColon, ItemUseSegment)>: Sync, Unique<(FnArg, Option<Comma>)>: Sync, Unique<(Box<Type>, Option<Comma>)>: Sync, Unique<Stmt>: Sync, Unique<(ItemVariant, Option<Comma>)>: Sync, Unique<(Field, Option<Comma>)>: Sync, Unique<(ImplItem, Option<SemiColon>)>: Sync, Unique<File>: Sync, Unique<Expr>: Sync, Unique<Condition>: Sync, Unique<Block>: Sync, Unique<(Pat, Option<Comma>)>: Sync, Unique<Pat>: Sync, Unique<ExprElseIf>: Sync, Unique<(ExprMatchBranch, Option<Comma>)>: Sync, Unique<(Expr, Option<Comma>)>: Sync, Unique<(ExprSelectBranch, Option<Comma>)>: Sync, Unique<(FieldAssign, Option<Comma>)>: Sync, NonZero<u32>: Sync, Unique<Token>: Sync,

§

impl Unpin for ItemOrExpr

§

impl UnsafeUnpin for ItemOrExpr
where *const Attribute is !null: UnsafeUnpin, PhantomData<Attribute>: UnsafeUnpin, *const (PathSegmentExpr, Option<Comma>) is !null: UnsafeUnpin, PhantomData<(PathSegmentExpr, Option<Comma>)>: UnsafeUnpin, *const (ColonColon, PathSegment) is !null: UnsafeUnpin, PhantomData<(ColonColon, PathSegment)>: UnsafeUnpin, *const (ItemUsePath, Option<Comma>) is !null: UnsafeUnpin, PhantomData<(ItemUsePath, Option<Comma>)>: UnsafeUnpin, *const (ColonColon, ItemUseSegment) is !null: UnsafeUnpin, PhantomData<(ColonColon, ItemUseSegment)>: UnsafeUnpin, *const (FnArg, Option<Comma>) is !null: UnsafeUnpin, PhantomData<(FnArg, Option<Comma>)>: UnsafeUnpin, *const (Box<Type>, Option<Comma>) is !null: UnsafeUnpin, PhantomData<(Box<Type>, Option<Comma>)>: UnsafeUnpin, *const Stmt is !null: UnsafeUnpin, PhantomData<Stmt>: UnsafeUnpin, *const (ItemVariant, Option<Comma>) is !null: UnsafeUnpin, PhantomData<(ItemVariant, Option<Comma>)>: UnsafeUnpin, *const (Field, Option<Comma>) is !null: UnsafeUnpin, PhantomData<(Field, Option<Comma>)>: UnsafeUnpin, *const (ImplItem, Option<SemiColon>) is !null: UnsafeUnpin, PhantomData<(ImplItem, Option<SemiColon>)>: UnsafeUnpin, *const File is !null: UnsafeUnpin, PhantomData<File>: UnsafeUnpin, *const Expr is !null: UnsafeUnpin, PhantomData<Expr>: UnsafeUnpin, *const Condition is !null: UnsafeUnpin, PhantomData<Condition>: UnsafeUnpin, *const Block is !null: UnsafeUnpin, PhantomData<Block>: UnsafeUnpin, *const (Pat, Option<Comma>) is !null: UnsafeUnpin, PhantomData<(Pat, Option<Comma>)>: UnsafeUnpin, *const Pat is !null: UnsafeUnpin, PhantomData<Pat>: UnsafeUnpin, *const ExprElseIf is !null: UnsafeUnpin, PhantomData<ExprElseIf>: UnsafeUnpin, *const (ExprMatchBranch, Option<Comma>) is !null: UnsafeUnpin, PhantomData<(ExprMatchBranch, Option<Comma>)>: UnsafeUnpin, *const (Expr, Option<Comma>) is !null: UnsafeUnpin, PhantomData<(Expr, Option<Comma>)>: UnsafeUnpin, *const (ExprSelectBranch, Option<Comma>) is !null: UnsafeUnpin, PhantomData<(ExprSelectBranch, Option<Comma>)>: UnsafeUnpin, *const (FieldAssign, Option<Comma>) is !null: UnsafeUnpin, PhantomData<(FieldAssign, Option<Comma>)>: UnsafeUnpin, NonZeroU32Inner: UnsafeUnpin, *const Token is !null: UnsafeUnpin, PhantomData<Token>: UnsafeUnpin,

§

impl UnwindSafe for ItemOrExpr

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> TryToOwned for T
where T: TryClone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn try_to_owned(&self) -> Result<T, Error>

Creates owned data from borrowed data, usually by cloning. Read more
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more