pub struct RequiredDict<K: DictKey, V> { /* private fields */ }Expand description
A dictionary that requires all keys to have values
Implementations§
Source§impl<K: DictKey, V> RequiredDict<K, V>
impl<K: DictKey, V> RequiredDict<K, V>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn from_fn<F>(f: F) -> Selfwhere
F: FnMut(K) -> V,
pub fn try_from_fn<F, E>(f: F) -> Result<Self, E>
pub fn map<F, U>(self, f: F) -> RequiredDict<K, U>where
F: FnMut(V) -> U,
pub fn try_map<F, U, E>(self, f: F) -> Result<RequiredDict<K, U>, E>
pub fn each_ref(&self) -> RequiredDict<K, &V>
pub fn each_mut(&mut self) -> RequiredDict<K, &mut V>
pub fn downgrade(self) -> OptionalDict<K, V>
Trait Implementations§
Source§impl<K: DictKey, V> From<OptionalDict<K, V>> for RequiredDict<K, Option<V>>
impl<K: DictKey, V> From<OptionalDict<K, V>> for RequiredDict<K, Option<V>>
Source§fn from(dict: OptionalDict<K, V>) -> Self
fn from(dict: OptionalDict<K, V>) -> Self
Converts to this type from the input type.
Source§impl<K: DictKey, V> From<RequiredDict<K, Option<V>>> for OptionalDict<K, V>
impl<K: DictKey, V> From<RequiredDict<K, Option<V>>> for OptionalDict<K, V>
Source§fn from(dict: RequiredDict<K, Option<V>>) -> Self
fn from(dict: RequiredDict<K, Option<V>>) -> Self
Converts to this type from the input type.
Source§impl<K: DictKey, V> Index<K> for RequiredDict<K, V>
impl<K: DictKey, V> Index<K> for RequiredDict<K, V>
Source§impl<K: DictKey, V> IndexMut<K> for RequiredDict<K, V>
impl<K: DictKey, V> IndexMut<K> for RequiredDict<K, V>
Source§impl<K: DictKey, V> IntoIterator for RequiredDict<K, V>
impl<K: DictKey, V> IntoIterator for RequiredDict<K, V>
Source§impl<K: DictKey, V: Ord> Ord for RequiredDict<K, V>
impl<K: DictKey, V: Ord> Ord for RequiredDict<K, V>
Source§impl<K: DictKey, V: PartialOrd> PartialOrd for RequiredDict<K, V>
impl<K: DictKey, V: PartialOrd> PartialOrd for RequiredDict<K, V>
impl<K: DictKey, V: Copy> Copy for RequiredDict<K, V>
impl<K: DictKey, V: Eq> Eq for RequiredDict<K, V>
Auto Trait Implementations§
impl<K, V> Freeze for RequiredDict<K, V>
impl<K, V> RefUnwindSafe for RequiredDict<K, V>
impl<K, V> Send for RequiredDict<K, V>
impl<K, V> Sync for RequiredDict<K, V>
impl<K, V> Unpin for RequiredDict<K, V>
impl<K, V> UnwindSafe for RequiredDict<K, V>
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