pub enum InvocationContext {
Expr,
Item,
Pat,
Stmt,
Ty,
}
Expand description
The contexts in which a macro can be called.
All macros can’t be called in all contexts. For instance, a macro that
expands to a pattern may not be called where an expression is expected.
This type allows the check_macro
function to know the context the macro
will be invoked in.
Variants§
Expr
The macro expands to an expression.
Item
The macro expands to any number of item.
Pat
The macro expands to a pattern.
Stmt
The macro expands to any number of statement.
Ty
The macro expands to a type.
Trait Implementations§
Source§impl Clone for InvocationContext
impl Clone for InvocationContext
Source§fn clone(&self) -> InvocationContext
fn clone(&self) -> InvocationContext
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 Debug for InvocationContext
impl Debug for InvocationContext
Source§impl FromStr for InvocationContext
impl FromStr for InvocationContext
Source§impl PartialEq for InvocationContext
impl PartialEq for InvocationContext
impl Copy for InvocationContext
impl StructuralPartialEq for InvocationContext
Auto Trait Implementations§
impl Freeze for InvocationContext
impl RefUnwindSafe for InvocationContext
impl Send for InvocationContext
impl Sync for InvocationContext
impl Unpin for InvocationContext
impl UnwindSafe for InvocationContext
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