pub struct AppendOnly<T>(/* private fields */);Expand description
Append-only Vec supporting concurrent writes
Implementations§
Source§impl<T> AppendOnly<T>
impl<T> AppendOnly<T>
pub fn new() -> Self
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
pub fn clear(&self)
pub fn push(&self, val: T)
pub fn read(&self) -> Guard<Arc<Vec<T>>>
pub fn is_expired(&self, guard: &Guard<Arc<Vec<T>>>) -> bool
pub fn map_to_vec<U, F>(&self, f: F) -> Vec<U>
Trait Implementations§
Source§impl<T: Clone> Clone for AppendOnly<T>
impl<T: Clone> Clone for AppendOnly<T>
Source§fn clone(&self) -> AppendOnly<T>
fn clone(&self) -> AppendOnly<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for AppendOnly<T>
impl<T: Debug> Debug for AppendOnly<T>
Auto Trait Implementations§
impl<T> Freeze for AppendOnly<T>
impl<T> RefUnwindSafe for AppendOnly<T>
impl<T> Send for AppendOnly<T>
impl<T> Sync for AppendOnly<T>
impl<T> Unpin for AppendOnly<T>
impl<T> UnsafeUnpin for AppendOnly<T>
impl<T> UnwindSafe for AppendOnly<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> TransformExt for T
impl<T> TransformExt for T
fn transform<Q>(self, transform: impl FnOnce(T) -> Q) -> Q
fn modify<Q>(self, modify: impl FnOnce(&mut T) -> Q) -> T
Source§fn modify_if<Q>(self, condition: bool, modify: impl FnOnce(&mut T) -> Q) -> T
fn modify_if<Q>(self, condition: bool, modify: impl FnOnce(&mut T) -> Q) -> T
Example Read more