pub struct Ctx<K, V>(/* private fields */);Expand description
General BTreeMap context
Implementations§
Source§impl<K: Ord, V> Ctx<K, V>
Special and wrapper methods for Ctx
impl<K: Ord, V> Ctx<K, V>
Special and wrapper methods for Ctx
pub fn new() -> Self
pub fn singleton(k: K, v: V) -> Self
pub fn insert_with<FF>(&mut self, k: K, v1: V, f: &FF)
pub fn insert(&mut self, k: K, v: V)where
V: Clone,
pub fn append_with<It, FF>(&mut self, it: It, f: &FF) -> &mut Self
pub fn append<It>(&mut self, it: It) -> &mut Self
pub fn union_with<FF>(&self, other: Self, f: &FF) -> Self
pub fn union(&self, other: Self) -> Self
pub fn intersection_with<VV, FF>(&self, other: Self, f: &FF) -> Ctx<K, VV>
pub fn is_empty(&self) -> bool
pub fn get(&self, k: &K) -> Option<&V>
pub fn get_mut(&mut self, k: &K) -> Option<&mut V>
pub fn remove(&mut self, k: &K) -> Option<V>where
V: Clone,
pub fn keys(&self) -> Set<&K>
pub fn contains(&self, k: &K) -> bool
pub fn iter(&self) -> CtxIterator<'_, K, V> ⓘ
pub fn iter_mut(&mut self) -> impl Iterator<Item = (&K, &mut V)>
pub fn modify<F>(&mut self, f: F)
pub fn retain(&mut self, f: impl Fn(&K, &mut V) -> bool)
pub fn extract_if(&mut self, f: impl Fn(&K, &V) -> bool) -> Ctx<K, V>
Trait Implementations§
Source§impl<X, Y, K: From<X> + Ord, V: From<Y>, const N: usize> From<[(X, Y); N]> for Ctx<K, V>
From instance
impl<X, Y, K: From<X> + Ord, V: From<Y>, const N: usize> From<[(X, Y); N]> for Ctx<K, V>
From instance
Source§impl<K, V> IntoIterator for Ctx<K, V>
IntoIterator instance for Ctx
impl<K, V> IntoIterator for Ctx<K, V>
IntoIterator instance for Ctx
Source§impl<K: Ord, V: Ord> Ord for Ctx<K, V>
impl<K: Ord, V: Ord> Ord for Ctx<K, V>
Source§impl<K: PartialOrd, V: PartialOrd> PartialOrd for Ctx<K, V>
impl<K: PartialOrd, V: PartialOrd> PartialOrd for Ctx<K, V>
Source§impl<'a, D, A, K, V> Pretty<'a, D, A> for Ctx<K, V>
Pretty printer instance for Ctx
impl<'a, D, A, K, V> Pretty<'a, D, A> for Ctx<K, V>
Pretty printer instance for Ctx
Source§fn pretty(self, allocator: &'a D) -> DocBuilder<'a, D, A>
fn pretty(self, allocator: &'a D) -> DocBuilder<'a, D, A>
Converts
self into a documentimpl<K: Eq, V: Eq> Eq for Ctx<K, V>
impl<K, V> StructuralPartialEq for Ctx<K, V>
Auto Trait Implementations§
impl<K, V> Freeze for Ctx<K, V>
impl<K, V> RefUnwindSafe for Ctx<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for Ctx<K, V>
impl<K, V> Sync for Ctx<K, V>
impl<K, V> Unpin for Ctx<K, V>
impl<K, V> UnwindSafe for Ctx<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
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