Skip to main content

DelimiterToken

Trait DelimiterToken 

Source
pub trait DelimiterToken: Parse + DelimiterValue {
    const KIND: DelimiterKind;

    // Required methods
    fn new(spans: DoubleSpan) -> Self;
    fn spans(&self) -> DoubleSpan;
}
Expand description

A generated typed refinement of one raw delimiter kind.

Delimiter atoms are the container analogue of Token![..]: the typed CST stores the precise delimiter family, while TokenGroup carries the erased raw representation.

Required Associated Constants§

Source

const KIND: DelimiterKind

The raw delimiter family represented by this type.

Required Methods§

Source

fn new(spans: DoubleSpan) -> Self

Creates a typed delimiter from its two boundary spans.

Source

fn spans(&self) -> DoubleSpan

Returns the real opening and closing boundaries this atom was built from, or a collapsed pair when it was constructed from one span.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§