pub struct PersistentMap<K: Ord + Clone, V: Clone> { /* private fields */ }Expand description
An immutable persistent map based on a binary search tree.
Operations return new map instances sharing structure with the original. Suitable for use in backtracking algorithms where previous states must be preserved.
Implementations§
Source§impl<K: Ord + Clone, V: Clone> PersistentMap<K, V>
impl<K: Ord + Clone, V: Clone> PersistentMap<K, V>
Sourcepub fn contains_key(&self, key: &K) -> bool
pub fn contains_key(&self, key: &K) -> bool
Check if the map contains a key.
Sourcepub fn to_sorted_vec(&self) -> Vec<(K, V)>
pub fn to_sorted_vec(&self) -> Vec<(K, V)>
Collect all key-value pairs in sorted order.
Trait Implementations§
Source§impl<K: Clone + Ord + Clone, V: Clone + Clone> Clone for PersistentMap<K, V>
impl<K: Clone + Ord + Clone, V: Clone + Clone> Clone for PersistentMap<K, V>
Source§fn clone(&self) -> PersistentMap<K, V>
fn clone(&self) -> PersistentMap<K, V>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<K, V> Freeze for PersistentMap<K, V>
impl<K, V> RefUnwindSafe for PersistentMap<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for PersistentMap<K, V>
impl<K, V> Sync for PersistentMap<K, V>
impl<K, V> Unpin for PersistentMap<K, V>
impl<K, V> UnsafeUnpin for PersistentMap<K, V>where
K: UnsafeUnpin,
V: UnsafeUnpin,
impl<K, V> UnwindSafe for PersistentMap<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