Skip to main content

CSNameMap

Trait CSNameMap 

Source
pub trait CSNameMap<C: Character, CS: CSName<C>, A: Clone>: Clone + Default {
    // Required methods
    fn get(&self, cs: &CS) -> Option<&A>;
    fn insert(&mut self, cs: CS, a: A) -> Option<A>;
    fn remove(&mut self, cs: &CS) -> Option<A>;
    fn into_iter(self) -> impl Iterator<Item = (CS, A)>;
}
Expand description

How to map control sequence names to e.g. Commands.

Required Methods§

Source

fn get(&self, cs: &CS) -> Option<&A>

Returns the value associated with the given control sequence name, if any.

Source

fn insert(&mut self, cs: CS, a: A) -> Option<A>

Inserts a new value for the given control sequence name, returning the old value if any.

Source

fn remove(&mut self, cs: &CS) -> Option<A>

Removes the value associated with the given control sequence name, returning it if any.

Source

fn into_iter(self) -> impl Iterator<Item = (CS, A)>

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§

Source§

impl<C: Character, A: Clone> CSNameMap<C, (NonZero<u32>, PhantomData<C>), A> for CSNameVec<C, A>

Source§

impl<C: Character, CS: CSName<C>, A: Clone> CSNameMap<C, CS, A> for HMap<CS, A>