Skip to main content

SymbolDomain

Trait SymbolDomain 

Source
pub trait SymbolDomain {
    type Symbol;
    type Offset: Copy + Debug + Eq + Ord;
}
Expand description

A symbol domain defines both the unit consumed by a pattern and its offset type.

Keeping the offset as an associated type prevents byte-oriented patterns from accidentally being paired with subjects indexed in code units.

Required Associated Types§

Source

type Symbol

One symbol consumed from a subject.

Source

type Offset: Copy + Debug + Eq + Ord

A position in both the pattern source and the subject.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§