EnumMapping

Trait EnumMapping 

Source
pub trait EnumMapping<T> {
    type Enum;
    type EnumIter<'a>: Iterator<Item = (Self::Enum, &'a T)>
       where T: 'a,
             Self: 'a;

    // Required methods
    fn get(&self, var: Self::Enum) -> &T;
    fn get_mut(&mut self, var: Self::Enum) -> &mut T;
    fn put(&mut self, var: Self::Enum, val: T);
    fn new<F: FnMut(Self::Enum) -> T>(f: F) -> Self;
    fn iter(&self) -> Self::EnumIter<'_>;
}

Required Associated Types§

Source

type Enum

Source

type EnumIter<'a>: Iterator<Item = (Self::Enum, &'a T)> where T: 'a, Self: 'a

Required Methods§

Source

fn get(&self, var: Self::Enum) -> &T

Source

fn get_mut(&mut self, var: Self::Enum) -> &mut T

Source

fn put(&mut self, var: Self::Enum, val: T)

Source

fn new<F: FnMut(Self::Enum) -> T>(f: F) -> Self

Source

fn iter(&self) -> Self::EnumIter<'_>

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§