pub struct LockedWrite<'a, T> { /* private fields */ }
Expand description
A handle to a SyncPushVec with write access protected by a lock.
Methods from Deref<Target = Write<'a, T>>§
Sourcepub fn push(&mut self, value: T) -> (&'a T, usize)
pub fn push(&mut self, value: T) -> (&'a T, usize)
Inserts a new element into the end of the table, and returns a refernce to it along with its index.
Sourcepub fn reserve(&mut self, additional: usize)
pub fn reserve(&mut self, additional: usize)
Reserves capacity for at least additional
more elements to be inserted
in the given vector. The collection may reserve more space to avoid
frequent reallocations. Does nothing if the capacity is already sufficient.
Sourcepub fn replace<I: IntoIterator<Item = T>>(&mut self, iter: I, capacity: usize)
pub fn replace<I: IntoIterator<Item = T>>(&mut self, iter: I, capacity: usize)
Replaces the content of the vector with the content of the iterator.
capacity
specifies the new capacity if it’s greater than the length of the iterator.
Trait Implementations§
Source§impl<'a, T> Deref for LockedWrite<'a, T>
impl<'a, T> Deref for LockedWrite<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for LockedWrite<'a, T>
impl<'a, T> !RefUnwindSafe for LockedWrite<'a, T>
impl<'a, T> !Send for LockedWrite<'a, T>
impl<'a, T> Sync for LockedWrite<'a, T>where
T: Sync,
impl<'a, T> Unpin for LockedWrite<'a, T>
impl<'a, T> !UnwindSafe for LockedWrite<'a, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more