pub struct Collision<K, V>(Box<[(K, V)]>);

Tuple Fields§

§0: Box<[(K, V)]>

Implementations§

source§

impl<K, V> Collision<K, V>

source

pub fn from_vec(vec: Vec<(K, V)>) -> Self

source

pub fn from_box(b: Box<[(K, V)]>) -> Self

source

pub fn len(&self) -> usize

source

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

source§

impl<K: Clone + PartialEq, V: Clone> Collision<K, V>

source

pub fn insert(&self, k: K, v: V) -> Result<Self, InsertError>

source

fn get_record_and_pos<Q>(&self, k: &Q) -> Option<(usize, &(K, V))>where K: Borrow<Q>, Q: PartialEq,

source

pub fn remove<Q>(&self, h: HashedKey, k: &Q) -> Result<Entry<K, V>, RemoveError>where K: Borrow<Q>, Q: PartialEq,

source

pub fn remove_match<Q>( &self, h: HashedKey, k: &Q, v: &V ) -> Result<Entry<K, V>, RemoveError>where K: Borrow<Q>, Q: PartialEq, V: PartialEq,

source

pub fn update<F, U>( &self, h: HashedKey, k: &K, f: F ) -> Result<Entry<K, V>, UpdateError<U>>where F: FnOnce(&V) -> Result<Option<V>, U>, U: Error + Debug + 'static,

source

pub fn replace(&self, k: &K, v: V) -> Result<(Self, V), ReplaceError>

source

pub fn replace_with<F>(&self, k: &K, f: F) -> Result<Self, ReplaceError>where F: FnOnce(&V) -> V,

Trait Implementations§

source§

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

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<K, V> RefUnwindSafe for Collision<K, V>where K: RefUnwindSafe, V: RefUnwindSafe,

§

impl<K, V> Send for Collision<K, V>where K: Send, V: Send,

§

impl<K, V> Sync for Collision<K, V>where K: Sync, V: Sync,

§

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

§

impl<K, V> UnwindSafe for Collision<K, V>where K: UnwindSafe, V: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.