Struct horde::sync_table::Read[][src]

pub struct Read<'a, K, V, S = DefaultHashBuilder> { /* fields omitted */ }

A handle to a SyncTable with read access.

It is acquired either by a pin, or by exclusive access to the table.

Implementations

impl<'a, K, V, S: BuildHasher> Read<'a, K, V, S>[src]

pub fn get_potential<Q: ?Sized>(
    self,
    key: &Q,
    hash: Option<u64>
) -> Result<(&'a K, &'a V), PotentialSlot<'a>> where
    K: Borrow<Q>,
    Q: Eq + Hash
[src]

Gets a reference to an element in the table or a potential location where that element could be.

pub fn get<Q: ?Sized>(
    self,
    key: &Q,
    hash: Option<u64>
) -> Option<(&'a K, &'a V)> where
    K: Borrow<Q>,
    Q: Eq + Hash
[src]

Gets a reference to an element in the table.

impl<'a, K, V, S> Read<'a, K, V, S>[src]

pub fn get_with_eq(
    self,
    hash: u64,
    eq: impl FnMut(&K, &V) -> bool
) -> Option<(&'a K, &'a V)>
[src]

Gets a reference to an element in the table with a custom equality function.

pub fn capacity(self) -> usize[src]

Returns the number of elements the map can hold without reallocating.

pub fn len(self) -> usize[src]

Returns the number of elements in the table.

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

Notable traits for Iter<'a, K, V>

impl<'a, K, V> Iterator for Iter<'a, K, V> type Item = (&'a K, &'a V);
[src]

An iterator visiting all key-value pairs in arbitrary order. The iterator element type is (&'a K, &'a V).

Trait Implementations

impl<K, V, S> Clone for Read<'_, K, V, S>[src]

impl<K, V, S> Copy for Read<'_, K, V, S>[src]

Auto Trait Implementations

impl<'a, K, V, S = RandomState> !RefUnwindSafe for Read<'a, K, V, S>

impl<'a, K, V, S> Send for Read<'a, K, V, S> where
    K: Sync,
    S: Sync,
    V: Sync

impl<'a, K, V, S> Sync for Read<'a, K, V, S> where
    K: Sync,
    S: Sync,
    V: Sync

impl<'a, K, V, S> Unpin for Read<'a, K, V, S>

impl<'a, K, V, S = RandomState> !UnwindSafe for Read<'a, K, V, S>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.