Enum hamt::RcTrick [] [src]

pub enum RcTrick<K, V> {
    RcTrick(Rc<Hamt<K, V, RcTrick<K, V>>>),
}

Variants

RcTrick

Methods from Deref<Target=Hamt<K, V, RcTrick<K, V>>>

fn len(&self) -> usize

fn is_empty(&self) -> bool

fn iter(&self) -> Iter<K, V, HamtRef>

Returns a key value iterator.

fn keys(&self) -> Keys<K, V, HamtRef>

Returns an iterator that visits every key in an unspecified order.

fn values(&self) -> Values<K, V, HamtRef>

Returns an iterator that visits every value in an unspecified order.

fn get<Q: ?Sized>(&self, k: &Q) -> Option<&V> where K: Borrow<Q>, Q: Hash + Eq

Returns a reference to the value corresponding to the given key, or None if there is no value associated with the key.

fn contains_key<Q: ?Sized>(&self, k: &Q) -> bool where K: Borrow<Q>, Q: Hash + Eq

Returns true if the map contains the given key.

fn insert<Q: ?Sized, R: ?Sized>(&self, k: &Q, v: &R) -> Self where K: Borrow<Q>, Q: Hash + Eq + ToOwned<Owned=K>, V: Borrow<R>, R: ToOwned<Owned=V>

fn remove<Q: ?Sized>(&self, k: &Q) -> Self where K: Borrow<Q>, Q: Hash + Eq

Returns a new map without an entry corresponding to the given key.

fn adjust<F, Q: ?Sized>(&self, key: &Q, f: F) -> Self where F: FnOnce(&V) -> V, K: Borrow<Q>, Q: Hash + Eq

Modifies the value tied to the given key with the function f. Otherwise, the map returned is identical.

fn update<F, Q: ?Sized>(&self, key: &Q, f: F) -> Self where F: FnOnce(&V) -> Option<V>, K: Borrow<Q>, Q: Hash + Eq + ToOwned<Owned=K>

Updates the value at the given key using f. If f returns None, then the entry is removed.

fn alter<F, Q: ?Sized>(&self, key: &Q, f: F) -> Self where F: FnOnce(Option<&V>) -> Option<V>, K: Borrow<Q>, Q: Hash + Eq + ToOwned<Owned=K>

Updates the value at the given key using f as in Self::update. If no value exists for the given key, then f is passed None.

Trait Implementations

impl<K, V> From<Hamt<K, V, RcTrick<K, V>>> for RcTrick<K, V>

fn from(t: Hamt<K, V, RcTrick<K, V>>) -> Self

impl<K, V> Deref for RcTrick<K, V>

type Target = Hamt<K, V, RcTrick<K, V>>

fn deref(&self) -> &Self::Target

Derived Implementations

impl<K: Eq, V: Eq> Eq for RcTrick<K, V>

impl<K: PartialEq, V: PartialEq> PartialEq for RcTrick<K, V>

fn eq(&self, __arg_0: &RcTrick<K, V>) -> bool

fn ne(&self, __arg_0: &RcTrick<K, V>) -> bool

impl<K: Debug, V: Debug> Debug for RcTrick<K, V>

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl<K: Clone, V: Clone> Clone for RcTrick<K, V>

fn clone(&self) -> RcTrick<K, V>

fn clone_from(&mut self, source: &Self)