pub trait Layout: Sized + 'static {
// Required methods
fn v_open() -> Self;
fn v_close() -> Self;
fn v_sep() -> Self;
}Expand description
Token types that participate in layout must implement Layout so the lexer
can construct virtual open/close/separator tokens to splice into the stream.
The user’s token enum picks names for these three variants (e.g.
VOpen/VClose/VSemi, or Indent/Dedent/Newline). Only the three
constructor methods are required; classification of which real tokens
open a block is configured separately via LayoutConfig.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".