Struct HamtMap

Source
pub struct HamtMap<K, V, IS = ShareStore<K, V>, H = DefaultHasher> { /* private fields */ }

Implementations§

Source§

impl<K, V, IS, H> HamtMap<K, V, IS, H>
where K: Eq + Send + Sync + Hash, V: Send + Sync, IS: ItemStore<K, V>, H: Hasher + Default,

Source

pub fn new() -> HamtMap<K, V, IS, H>

Source

pub fn iter<'a>(&'a self) -> HamtMapIterator<'a, K, V, IS, H>

Source

pub fn find<'a>(&'a self, key: &K) -> Option<&'a V>

Source

pub fn len(&self) -> usize

Source

pub fn insert(self, key: K, value: V) -> (HamtMap<K, V, IS, H>, bool)

Inserts a key-value pair into the map. An existing value for a key is replaced by the new value. The first tuple element of the return value is the new map instance representing the map after the insertion. The second tuple element is true if the size of the map was changed by the operation and false otherwise.

Source

pub fn remove(self, key: &K) -> (HamtMap<K, V, IS, H>, bool)

Removes a key-value pair from the map. The first tuple element of the return value is the new map instance representing the map after the insertion. The second tuple element is true if the size of the map was changed by the operation and false otherwise.

Source

pub fn plus(self, key: K, val: V) -> HamtMap<K, V, IS, H>

Inserts a key-value pair into the map. Same as insert() but with a return type that’s better suited to chaining multiple calls together.

Source

pub fn minus(self, key: &K) -> HamtMap<K, V, IS, H>

Removes a key-value pair from the map. Same as remove() but with a return type that’s better suited to chaining multiple call together

Trait Implementations§

Source§

impl<K, V, IS, H> Clone for HamtMap<K, V, IS, H>

Source§

fn clone(&self) -> HamtMap<K, V, IS, H>

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, V, IS, H> Default for HamtMap<K, V, IS, H>
where K: Eq + Send + Sync + Hash, V: Send + Sync, IS: ItemStore<K, V>, H: Hasher + Default,

Source§

fn default() -> HamtMap<K, V, IS, H>

Returns the “default value” for a type. Read more
Source§

impl<K, V, IS, H> FromIterator<(K, V)> for HamtMap<K, V, IS, H>
where K: Eq + Send + Sync + Hash, V: Send + Sync, IS: ItemStore<K, V>, H: Hasher + Default,

Source§

fn from_iter<T>(iterator: T) -> Self
where T: IntoIterator<Item = (K, V)>,

Creates a value from an iterator. Read more
Source§

impl<'a, K, V, IS, H> IntoIterator for &'a HamtMap<K, V, IS, H>
where K: Eq + Send + Sync + Hash + 'a, V: Send + Sync + 'a, IS: ItemStore<K, V> + 'a, H: Hasher + Default + 'a,

Source§

type Item = (&'a K, &'a V)

The type of the elements being iterated over.
Source§

type IntoIter = HamtMapIterator<'a, K, V, IS, H>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> HamtMapIterator<'a, K, V, IS, H>

Creates an iterator from a value. Read more
Source§

impl<K, V, IS, H> PartialEq for HamtMap<K, V, IS, H>
where K: Eq + Send + Sync + Hash, V: PartialEq + Send + Sync, IS: ItemStore<K, V>, H: Hasher + Default,

Source§

fn eq(&self, other: &HamtMap<K, V, IS, H>) -> bool

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

fn ne(&self, other: &HamtMap<K, V, IS, H>) -> bool

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

impl<K, V, IS, H> Eq for HamtMap<K, V, IS, H>
where K: Eq + Send + Sync + Hash, V: Eq + Send + Sync, IS: ItemStore<K, V>, H: Hasher + Default,

Auto Trait Implementations§

§

impl<K, V, IS, H> Freeze for HamtMap<K, V, IS, H>

§

impl<K, V, IS, H> RefUnwindSafe for HamtMap<K, V, IS, H>

§

impl<K, V, IS = ShareStore<K, V>, H = DefaultHasher> !Send for HamtMap<K, V, IS, H>

§

impl<K, V, IS = ShareStore<K, V>, H = DefaultHasher> !Sync for HamtMap<K, V, IS, H>

§

impl<K, V, IS, H> Unpin for HamtMap<K, V, IS, H>

§

impl<K, V, IS, H> UnwindSafe for HamtMap<K, V, IS, H>

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<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.