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", so this trait is not object safe.
Implementations on Foreign Types§
Implementors§
impl Peek for TokenKind
Use a TokenKind
to match by exact equality
impl Peek for AnyLit
impl Peek for LAngle
impl Peek for NonReserved
impl Peek for RAngle
impl<F: FnOnce(TokenKind) -> bool + Copy> Peek for F
An arbitrary peek rule defined by a predicate on TokenKind