pub struct PerfectMap<V: Copy + 'static, const N: usize> { /* private fields */ }Expand description
A map from the strings of a fixed set to values, built at compile time.
use cranpose_core::collections::perfect_map::PerfectMap;
const DIGITS: PerfectMap<u8, 3> = PerfectMap::new([("zero", 0), ("one", 1), ("two", 2)]);
assert_eq!(DIGITS.get("one"), Some(&1));
assert_eq!(DIGITS.get("three"), None);Implementations§
Auto Trait Implementations§
impl<V, const N: usize> Forget for PerfectMap<V, N>
impl<V, const N: usize> Freeze for PerfectMap<V, N>
impl<V, const N: usize> Move for PerfectMap<V, N>
impl<V, const N: usize> RefUnwindSafe for PerfectMap<V, N>
impl<V, const N: usize> Send for PerfectMap<V, N>
impl<V, const N: usize> Sync for PerfectMap<V, N>
impl<V, const N: usize> Unpin for PerfectMap<V, N>
impl<V, const N: usize> UnsafeUnpin for PerfectMap<V, N>
impl<V, const N: usize> UnwindSafe for PerfectMap<V, N>
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