pub trait CharacterMap<C: Character, A: Default>: Clone {
// Required methods
fn get(&self, c: C) -> &A;
fn get_mut(&mut self, c: C) -> &mut A;
fn default() -> Self;
}Expand description
A map from characters C:Character to some other type A. For u8, we can simply use [A;256].
For example, a CategoryCodeScheme is a CharacterMap<CategoryCode>.
Required Methods§
fn get(&self, c: C) -> &A
fn get_mut(&mut self, c: C) -> &mut A
fn default() -> Self
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.