pub struct Flag(pub Arc<RwLock<bool>>);Expand description
Structure that consists of a bool wrapped in Arc and RwLock to ensure thread safety and protect against race conditions.
Since the RwLock used is from the tokio, it can be used asynchronously.
Important: Before passing the flag to a new thread clone it.
Tuple Fields§
§0: Arc<RwLock<bool>>Implementations§
Source§impl Flag
impl Flag
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Flag
impl !UnwindSafe for Flag
impl Freeze for Flag
impl Send for Flag
impl Sync for Flag
impl Unpin for Flag
impl UnsafeUnpin 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