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