Enum ra_ap_parser::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