CSHandler

Trait CSHandler 

Source
pub trait CSHandler<C: Character, CS: CSName<C>>: Default + Clone {
    type Resolved<'a>: ResolvedCSName<'a, C>
       where Self: 'a;

    // Required methods
    fn cs_from_str(&mut self, s: &str) -> CS;
    fn cs_from_chars(&mut self, v: &[C]) -> CS;
    fn resolve<'a>(&'a self, cs: &'a CS) -> Self::Resolved<'a>;
    fn par(&self) -> CS;
    fn empty_str(&self) -> CS;
    fn get(&self, s: &str) -> Option<CS>;
}
Expand description

Handles control sequence names - conversion from/to strings, displaying etc.

Required Associated Types§

Source

type Resolved<'a>: ResolvedCSName<'a, C> where Self: 'a

The type of the resolved control sequence name (for displaying / iterating over the underlying Characters.

Required Methods§

Source

fn cs_from_str(&mut self, s: &str) -> CS

Creates a new control sequence name from a string.

Source

fn cs_from_chars(&mut self, v: &[C]) -> CS

Creates a new control sequence name from a vector of characters.

Source

fn resolve<'a>(&'a self, cs: &'a CS) -> Self::Resolved<'a>

Resolves a control sequence name.

Source

fn par(&self) -> CS

Returns the name of the \par control sequence.

Source

fn empty_str(&self) -> CS

Returns the name of the empty control sequence.

Source

fn get(&self, s: &str) -> Option<CS>

Creates a control sequence name from a string slice iff it is a previously interned control sequence name.

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§

Source§

impl<C: Character> CSHandler<C, Rc<str>> for ()

Source§

type Resolved<'a> = &'a str

Source§

fn cs_from_str(&mut self, s: &str) -> Ptr<str>

Source§

fn get(&self, s: &str) -> Option<Ptr<str>>

Source§

fn resolve<'a>(&'a self, cs: &'a Ptr<str>) -> Self::Resolved<'a>

Source§

fn par(&self) -> Ptr<str>

Source§

fn empty_str(&self) -> Ptr<str>

Source§

fn cs_from_chars(&mut self, v: &[C]) -> Ptr<str>

Implementors§