Struct horde::sync_table::LockedWrite[][src]

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

A handle to a SyncTable with write access protected by a lock.

Methods from Deref<Target = Write<'a, K, V, S>>

pub fn read(&self) -> Read<'_, K, V, S>[src]

Creates a Read handle which gives access to read operations.

pub fn hasher(&self) -> &'a S[src]

Returns a reference to the table’s BuildHasher.

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

Removes an element from the table, and returns a reference to it if was present.

pub fn insert(&mut self, key: K, value: V, hash: Option<u64>) -> bool[src]

Inserts a element into the table. Returns false if it already exists and doesn’t update the value.

pub fn insert_new(
    &mut self,
    key: K,
    value: V,
    hash: Option<u64>
) -> (&'a K, &'a V)
[src]

Inserts a new element into the table, and returns a reference to it.

This does not check if the given element already exists in the table.

pub fn reserve_one(&mut self)[src]

Reserve room for one more element.

pub fn replace<I: IntoIterator<Item = (K, V)>>(
    &mut self,
    iter: I,
    capacity: usize
)
[src]

Replaces the content of the table with the content of the iterator. All the elements must be unique. capacity specifies the new capacity if it’s greater than the length of the iterator.

Trait Implementations

impl<'a, K, V, S> Deref for LockedWrite<'a, K, V, S>[src]

type Target = Write<'a, K, V, S>

The resulting type after dereferencing.

impl<'a, K, V, S> DerefMut for LockedWrite<'a, K, V, S>[src]

Auto Trait Implementations

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

impl<'a, K, V, S = RandomState> !Send for LockedWrite<'a, K, V, S>

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

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

impl<'a, K, V, S = RandomState> !UnwindSafe for LockedWrite<'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, 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.