pub struct ConcurrentVec<T> { /* private fields */ }Expand description
A simple concurrent vector type supporting push operations that do not block reads. Concurrent pushes are serialized, but reads need not wait for writes to complete, except when the vector needs to be resized.
Implementations§
Source§impl<T> ConcurrentVec<T>
impl<T> ConcurrentVec<T>
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a new AsyncVec with the given starting capacity.
Sourcepub fn push(&self, item: T) -> usize
pub fn push(&self, item: T) -> usize
Push item onto the vector. Other calls to push may have to complete
in order for this item to be visible.
pub fn read(&self) -> impl Deref<Target = [T]> + '_
Trait Implementations§
Source§impl<T> Default for ConcurrentVec<T>
impl<T> Default for ConcurrentVec<T>
Auto Trait Implementations§
impl<T> !Freeze for ConcurrentVec<T>
impl<T> !RefUnwindSafe for ConcurrentVec<T>
impl<T> Send for ConcurrentVec<T>where
T: Send,
impl<T> Sync for ConcurrentVec<T>where
T: Send,
impl<T> Unpin for ConcurrentVec<T>where
T: Unpin,
impl<T> UnwindSafe for ConcurrentVec<T>where
T: UnwindSafe,
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