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 Freeze for TopEntryPoint
impl RefUnwindSafe for TopEntryPoint
impl Send for TopEntryPoint
impl Sync for TopEntryPoint
impl Unpin for TopEntryPoint
impl UnwindSafe for TopEntryPoint
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