pub struct AtomicUsizeArray { /* private fields */ }
Expand description
A usize
array in which elements may be updated atomically.
Implementations§
Source§impl AtomicUsizeArray
impl AtomicUsizeArray
Sourcepub fn new(len: usize) -> Self
pub fn new(len: usize) -> Self
Constructs a new array with the specified length. All values will be initialized to their default.
Sourcepub fn new_with(len: usize, f: impl Fn(usize) -> usize) -> Self
pub fn new_with(len: usize, f: impl Fn(usize) -> usize) -> Self
Constructs a new array with the specified length. Uses the given function to construct each value.
Sourcepub fn load(&self, index: usize) -> usize
pub fn load(&self, index: usize) -> usize
Loads and returns the value at the given position.
Panics if index
is out of bounds.
Auto Trait Implementations§
impl Freeze for AtomicUsizeArray
impl RefUnwindSafe for AtomicUsizeArray
impl Send for AtomicUsizeArray
impl Sync for AtomicUsizeArray
impl Unpin for AtomicUsizeArray
impl UnwindSafe for AtomicUsizeArray
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