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

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.