Skip to main content

AtomicVec

Struct AtomicVec 

Source
pub struct AtomicVec<T> { /* private fields */ }

Implementations§

Source§

impl<T> AtomicVec<T>

Source

pub fn new() -> Self

Source

pub fn with_capacity(cap: usize) -> Self

Source

pub fn init_with<F: FnMut() -> T>(cap: usize, init: F) -> Self

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn capacity(&self) -> usize

Source

pub fn push(&self, value: T)

Source

pub fn push_batch<I: IntoIterator<Item = T>>(&self, iter: I)

Source

pub fn pop(&self) -> Option<T>

Source

pub fn pop_batch(&self, count: usize) -> Vec<T>

Source

pub fn drain(&self) -> Vec<T>

Source

pub fn reset_with(&self, cap: usize, init: impl FnMut() -> T) -> usize

Source

pub fn as_vec(&self) -> Vec<T>

Source§

impl<T: PartialEq> AtomicVec<T>

Source

pub fn index_of(&self, value: &T) -> Option<usize>

Source

pub fn contains(&self, value: &T) -> bool

Source§

impl<T> AtomicVec<T>

Source

pub fn find<F>(&self, predicate: F) -> Option<T>
where F: Fn(&T) -> bool, T: Clone,

Source

pub fn for_each<F>(&self, f: F)
where F: Fn(&T),

Source

pub fn fold<B, F>(&self, init: B, f: F) -> B
where F: Fn(B, &T) -> B,

Source

pub fn reduce<F>(&self, f: F) -> Option<T>
where F: Fn(T, &T) -> T, T: Clone,

Source

pub fn get(&self, index: usize) -> Option<T>
where T: Clone,

Source

pub fn swap(&self, i: usize, j: usize) -> bool

Source

pub fn remove(&self, index: usize) -> Option<T>

Source

pub fn reverse(&self)

Trait Implementations§

Source§

impl<T> Clone for AtomicVec<T>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug> Debug for AtomicVec<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T> Default for AtomicVec<T>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<T> Drop for AtomicVec<T>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<T> FromIterator<T> for AtomicVec<T>

Source§

fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl<T: Send> Send for AtomicVec<T>

Source§

impl<T: Send> Sync for AtomicVec<T>

Auto Trait Implementations§

§

impl<T> Freeze for AtomicVec<T>

§

impl<T> RefUnwindSafe for AtomicVec<T>

§

impl<T> Unpin for AtomicVec<T>

§

impl<T> UnsafeUnpin for AtomicVec<T>

§

impl<T> UnwindSafe for AtomicVec<T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.