Enum ra_ap_mbe::TopEntryPoint
source · [−]pub enum TopEntryPoint {
SourceFile,
MacroStmts,
MacroItems,
Pattern,
Type,
Expr,
MetaItem,
}
Expand description
Parse the whole of the input as a given syntactic construct.
This covers two main use-cases:
- Parsing a Rust file.
- Parsing a result of macro expansion.
That is, for something like
quick_check! {
fn prop() {}
}
the input to the macro will be parsed with PrefixEntryPoint::Item
, and
the result will be TopEntryPoint::MacroItems
.
TopEntryPoint::parse
makes a guarantee that
- all input is consumed
- the result is a valid tree (there’s one root node)
Variants
SourceFile
MacroStmts
MacroItems
Pattern
Type
Expr
MetaItem
Edge case – macros generally don’t expand to attributes, with the
exception of cfg_attr
which does!
Implementations
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for TopEntryPoint
impl Send for TopEntryPoint
impl Sync for TopEntryPoint
impl Unpin for TopEntryPoint
impl UnwindSafe for TopEntryPoint
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
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more