pub struct Latch { /* private fields */ }
Expand description
A lock for cooperative multitasking environment
Implementations§
source§impl Latch
impl Latch
sourcepub fn lock(&self) -> LatchGuard
pub fn lock(&self) -> LatchGuard
Lock a latch. Waits indefinitely until the current fiber can gain access to the latch.
sourcepub fn try_lock(&self) -> Option<LatchGuard>
pub fn try_lock(&self) -> Option<LatchGuard>
Try to lock a latch. Return immediately if the latch is locked.
Returns:
Some
- successNone
- the latch is locked.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Latch
impl !Send for Latch
impl !Sync for Latch
impl Unpin for Latch
impl UnwindSafe for Latch
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