pub struct Flag(/* private fields */);Expand description
A thread-safe boolean flag.
Useful for tracking state flags that need to be accessed from multiple threads.
§Example
use spider_core::state::Flag;
let flag = Flag::new(false);
flag.set(true);
assert!(flag.get());Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Flag
impl RefUnwindSafe for Flag
impl Send for Flag
impl Sync for Flag
impl Unpin for Flag
impl UnsafeUnpin for Flag
impl UnwindSafe for Flag
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