Skip to main content

TokenTrait

Trait TokenTrait 

Source
pub trait TokenTrait
where Self: Sized + PartialEq,
{ // Required method fn match_char(c: char) -> Option<Self>; }
Expand description

The main trait for Tokens, it is the automatically implemented by the token attribute macro.

Required Methods§

Source

fn match_char(c: char) -> Option<Self>

Returns the enum element that matches the given char.

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§