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]
&mut self,
key: &Q,
hash: Option<u64>
) -> Option<(&'a K, &'a V)> where
K: Borrow<Q>,
Q: Eq + Hash,
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]
&mut self,
key: K,
value: V,
hash: Option<u64>
) -> (&'a K, &'a V)
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]
&mut self,
iter: I,
capacity: usize
)
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]
impl<'a, K, V, S> Deref 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,
K: Sync,
S: Sync,
V: Sync,