Skip to main content

peek

Function peek 

Source
pub fn peek<T, F>(
    input: ParseStream<'_>,
    ctx: &mut ParseContext,
    parser: F,
) -> Result<T>
where F: FnOnce(ParseStream<'_>, &mut ParseContext) -> Result<T>,
Expand description

Executes a parser on a fork, returning the result but NEVER advancing the input. Restores ParseContext state (scopes, last_span) to what it was before.