pub(crate) trait Peek: Copy {
// Required method
fn matches(self, tok: TokenKind, edition: Edition) -> bool;
}Expand description
A trait for testing whether a token matches a rule.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl Peek for Symbol
Use a [Symbol] to match a TokenKind::Ident equal to it.
impl Peek for Symbol
Use a [Symbol] to match a TokenKind::Ident equal to it.
Implementors§
impl Peek for AnyLit
impl Peek for LAngle
impl Peek for NonReserved
impl Peek for RAngle
impl Peek for TokenKind
Use a TokenKind to match by exact equality
impl<F: FnOnce(TokenKind) -> bool + Copy> Peek for F
An arbitrary peek rule defined by a predicate on TokenKind