Enum ArcTrick

Source
pub enum ArcTrick<K, V> {
    ArcTrick(Arc<Hamt<K, V, ArcTrick<K, V>>>),
}

Variants§

§

ArcTrick(Arc<Hamt<K, V, ArcTrick<K, V>>>)

Methods from Deref<Target = Hamt<K, V, ArcTrick<K, V>>>§

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

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

Returns a key value iterator.

Source

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

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

Source

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

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

Source

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

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

Source

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

Returns true if the map contains the given key.

Source

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

Source

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

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

Source

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

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

Source

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

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

Source

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

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§

Source§

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

Source§

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

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

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

Source§

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

The resulting type after dereferencing.
Source§

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

Dereferences the value.
Source§

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

Source§

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

Converts to this type from the input type.
Source§

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

Source§

fn eq(&self, other: &ArcTrick<K, V>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

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

Source§

impl<K, V> StructuralPartialEq for ArcTrick<K, V>

Auto Trait Implementations§

§

impl<K, V> Freeze for ArcTrick<K, V>

§

impl<K, V> RefUnwindSafe for ArcTrick<K, V>

§

impl<K, V> Send for ArcTrick<K, V>
where K: Sync + Send, V: Sync + Send,

§

impl<K, V> Sync for ArcTrick<K, V>
where K: Sync + Send, V: Sync + Send,

§

impl<K, V> Unpin for ArcTrick<K, V>

§

impl<K, V> UnwindSafe for ArcTrick<K, V>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.