pub struct ConcurrentVec<T> { /* private fields */ }Expand description
A thread-safe vector using RwLock.
Provides concurrent read access with exclusive write access.
§Example
use spider_core::state::ConcurrentVec;
let vec = ConcurrentVec::new();
vec.push(1);
vec.push(2);
assert_eq!(vec.len(), 2);Implementations§
Source§impl<T> ConcurrentVec<T>
impl<T> ConcurrentVec<T>
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates a vector with the specified capacity.
Trait Implementations§
Source§impl<T> Clone for ConcurrentVec<T>
impl<T> Clone for ConcurrentVec<T>
Source§impl<T: Debug> Debug for ConcurrentVec<T>
impl<T: Debug> Debug for ConcurrentVec<T>
Source§impl<T: Default> Default for ConcurrentVec<T>
impl<T: Default> Default for ConcurrentVec<T>
Source§fn default() -> ConcurrentVec<T>
fn default() -> ConcurrentVec<T>
Returns the “default value” for a type. Read more
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>
impl<T> Unpin for ConcurrentVec<T>where
T: Unpin,
impl<T> UnsafeUnpin for ConcurrentVec<T>
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