pub struct MultiMap<K, V> where
K: Ord + PartialEq + Clone,
V: Ord + PartialEq + Clone, {
map: BTreeMap<K, BTreeSet<V>>,
empty: BTreeSet<V>,
}
Fields
map: BTreeMap<K, BTreeSet<V>>
empty: BTreeSet<V>
Implementations
sourceimpl<K, V> MultiMap<K, V> where
K: Ord + PartialEq + Clone,
V: Ord + PartialEq + Clone,
impl<K, V> MultiMap<K, V> where
K: Ord + PartialEq + Clone,
V: Ord + PartialEq + Clone,
pub fn new() -> MultiMap<K, V>
pub fn insert(&mut self, key: K, value: V)
pub fn remove(&mut self, key: K, value: V)
pub fn get(&self, key: K) -> &BTreeSet<V>
pub fn set(&mut self, key: K, values: BTreeSet<V>)
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn borrow(&self) -> &BTreeMap<K, BTreeSet<V>>
pub fn consume(self) -> BTreeMap<K, BTreeSet<V>>
Trait Implementations
sourceimpl<K: Clone, V: Clone> Clone for MultiMap<K, V> where
K: Ord + PartialEq + Clone,
V: Ord + PartialEq + Clone,
impl<K: Clone, V: Clone> Clone for MultiMap<K, V> where
K: Ord + PartialEq + Clone,
V: Ord + PartialEq + Clone,
sourceimpl<K, V> Default for MultiMap<K, V> where
K: Ord + PartialEq + Clone,
V: Ord + PartialEq + Clone,
impl<K, V> Default for MultiMap<K, V> where
K: Ord + PartialEq + Clone,
V: Ord + PartialEq + Clone,
sourceimpl<K: PartialEq, V: PartialEq> PartialEq<MultiMap<K, V>> for MultiMap<K, V> where
K: Ord + PartialEq + Clone,
V: Ord + PartialEq + Clone,
impl<K: PartialEq, V: PartialEq> PartialEq<MultiMap<K, V>> for MultiMap<K, V> where
K: Ord + PartialEq + Clone,
V: Ord + PartialEq + Clone,
impl<K, V> StructuralPartialEq for MultiMap<K, V> where
K: Ord + PartialEq + Clone,
V: Ord + PartialEq + Clone,
Auto Trait Implementations
impl<K, V> RefUnwindSafe for MultiMap<K, V> where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for MultiMap<K, V> where
K: Send,
V: Send,
impl<K, V> Sync for MultiMap<K, V> where
K: Sync,
V: Sync,
impl<K, V> Unpin for MultiMap<K, V>
impl<K, V> UnwindSafe for MultiMap<K, V> where
K: RefUnwindSafe,
V: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more