Struct horde::sync_table::Write[][src]

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

A handle to a SyncTable with write access.

Implementations

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

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.

impl<'a, K: Send, V: Send + Clone, S: BuildHasher> Write<'a, K, V, S>[src]

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.

impl<'a, K: Hash + Eq + Send + Clone, V: Send + Clone, S: BuildHasher> Write<'a, K, V, S>[src]

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.

impl<'a, K: Hash + Send + Clone, V: Send + Clone, S: BuildHasher> Write<'a, K, V, S>[src]

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.

impl<K: Hash + Send, V: Send, S: BuildHasher> Write<'_, K, V, S>[src]

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.

Auto Trait Implementations

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

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

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

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

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