pub enum PrefixEntryPoint {
    Vis,
    Block,
    Stmt,
    Pat,
    Ty,
    Expr,
    Path,
    Item,
    MetaItem,
}
Expand description

Parse a prefix of the input as a given syntactic construct.

This is used by macro-by-example parser to implement things like $i:item and the naming of variants follows the naming of macro fragments.

Note that this is generally non-optional – the result is intentionally not Option<Output>. The way MBE work, by the time we try to parse $e:expr we already commit to expression. In other words, this API by design can’t be used to implement “rollback and try another alternative” logic.

Variants

Vis

Block

Stmt

Pat

Ty

Expr

Path

Item

MetaItem

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.