Struct enum_collections::EnumTable
source · pub struct EnumTable<K, V> { /* private fields */ }Expand description
A key-value table optimized for Enums used as keys. Initialized with V’s Default values.
use enum_collections::{EnumTable, Enumerated};
#[derive(Enumerated)]
enum Letter {
A,
B,
}
let mut map: EnumTable<Letter, u8> = EnumTable::new();
map[Letter::A] = 42;
assert_eq!(42u8, map[Letter::A]);
assert_eq!(u8::default(), map[Letter::B]);Implementations§
source§impl<K, V> EnumTable<K, V>where
K: Enumerated,
impl<K, V> EnumTable<K, V>where
K: Enumerated,
Trait Implementations§
source§impl<K, V> PartialEq for EnumTable<K, V>
impl<K, V> PartialEq for EnumTable<K, V>
impl<K, V> Eq for EnumTable<K, V>
Auto Trait Implementations§
impl<K, V> RefUnwindSafe for EnumTable<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for EnumTable<K, V>
impl<K, V> Sync for EnumTable<K, V>
impl<K, V> Unpin for EnumTable<K, V>where
K: Unpin,
impl<K, V> UnwindSafe for EnumTable<K, V>where
K: UnwindSafe,
V: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more