Struct atomic_array::AtomicIsizeArray [−][src]
pub struct AtomicIsizeArray { /* fields omitted */ }A isize array in which elements may be updated atomically.
Methods
impl AtomicIsizeArray[src]
impl AtomicIsizeArraypub fn new(len: usize) -> Self[src]
pub fn new(len: usize) -> SelfConstructs a new array with the specified length. All values will be initialized to their default.
pub fn new_with(
len: usize,
f: impl Fn(usize) -> isize
) -> Self[src]
pub fn new_with(
len: usize,
f: impl Fn(usize) -> isize
) -> SelfConstructs a new array with the specified length. Uses the given function to construct each value.
pub fn len(&self) -> usize[src]
pub fn len(&self) -> usizeReturns the number of elements in the array.
pub fn is_empty(&self) -> bool[src]
pub fn is_empty(&self) -> boolReturns true if the array has a length of 0.
pub fn load(&self, index: usize) -> isize[src]
pub fn load(&self, index: usize) -> isizeLoads and returns the value at the given position.
Panics if index is out of bounds.
pub fn store(&self, index: usize, value: isize)[src]
pub fn store(&self, index: usize, value: isize)Stores the value at the given position.
Panics if index is out bounds.
pub fn swap(&self, index: usize, value: isize) -> isize[src]
pub fn swap(&self, index: usize, value: isize) -> isizeSwaps the value at the given position, returning the previous value.
Panics if index is out of bounds.
Auto Trait Implementations
impl Send for AtomicIsizeArray
impl Send for AtomicIsizeArrayimpl Sync for AtomicIsizeArray
impl Sync for AtomicIsizeArray