pub struct AVec<T> { /* private fields */ }Expand description
Vector supporting multiple non-overlapping writers or multiple readers. Blocks during resizes only. !todo panics on concurrent reads+writes
Implementations§
Source§impl<T> AVec<T>
impl<T> AVec<T>
Sourcepub fn new(initial_capacity: usize) -> AVec<T>
pub fn new(initial_capacity: usize) -> AVec<T>
Creates a new instance with given inital capacity
Sourcepub fn push(&self, value: T) -> usize
pub fn push(&self, value: T) -> usize
Adds an element to the vector and returns the insert position.
Sourcepub fn map<'a>(&'a self, size: usize) -> AVecMapGuard<'a, T>
pub fn map<'a>(&'a self, size: usize) -> AVecMapGuard<'a, T>
Maps a slice of the vector for write access. Faster than individual pushes for size > 2.
Sourcepub fn get<'a>(&'a self) -> AVecReadGuard<'a, T>
pub fn get<'a>(&'a self) -> AVecReadGuard<'a, T>
Maps the entire vector for read access.
Trait Implementations§
Source§impl<T> Debug for AVec<T>where
T: Debug,
Provides debug formatting for T that implement fmt::Debug
impl<T> Debug for AVec<T>where
T: Debug,
Provides debug formatting for T that implement fmt::Debug
impl<T> Send for AVec<T>
impl<T> Sync for AVec<T>
Auto Trait Implementations§
impl<T> !Freeze for AVec<T>
impl<T> !RefUnwindSafe for AVec<T>
impl<T> Unpin for AVec<T>where
T: Unpin,
impl<T> UnwindSafe for AVec<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