Trait EasyPeek

Source
pub trait EasyPeek: Parse {
    // Required methods
    fn peek(lookahead1: &Lookahead1<'_>) -> bool;
    fn peek_stream(stream: ParseStream<'_>) -> bool;
}
Expand description

Provides interface for peeking first token before parsing.

May be implemented for complex structures by peeking first field.

Required Methods§

Source

fn peek(lookahead1: &Lookahead1<'_>) -> bool

Peek head token before parsing.

Source

fn peek_stream(stream: ParseStream<'_>) -> bool

Peek head token before parsing.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl EasyPeek for Arg
where for<'a> EasyPeekHack<'a, arg>: EasyPeek,

Source§

impl EasyPeek for Baz
where for<'a> EasyPeekHack<'a, Member>: EasyPeek,

Source§

impl EasyPeek for Foo
where for<'a> EasyPeekHack<'a, Ident>: EasyPeek,

Source§

impl EasyPeek for Outer

Source§

impl<T> EasyPeek for EasyBraced<T>
where T: Parse,

Source§

impl<T> EasyPeek for EasyBracketed<T>
where T: Parse,

Source§

impl<T> EasyPeek for EasyParenthesized<T>
where T: Parse,

Source§

impl<T> EasyPeek for T
where T: Token + Parse,

Source§

impl<T, P> EasyPeek for EasySeparated<T, P>
where T: EasyPeek, P: EasyPeek,

Source§

impl<V, T> EasyPeek for EasySubArgument<V, T>
where V: Parse, T: Parse,