Struct wait_list::LockedExclusive
source · [−]pub struct LockedExclusive<'wait_list, L: Lock, I, O> {
pub guard: <L as Lifetime<'wait_list>>::ExclusiveGuard,
/* private fields */
}Expand description
An exclusive lock on a WaitList, created by WaitList::lock_exclusive.
Fields
guard: <L as Lifetime<'wait_list>>::ExclusiveGuardThe lock guard holding the lock on the WaitList.
You can use this field to access whatever auxiliary locked state you have associated with
the WaitList.
Implementations
sourceimpl<'wait_list, L: Lock, I, O> LockedExclusive<'wait_list, L, I, O>
impl<'wait_list, L: Lock, I, O> LockedExclusive<'wait_list, L, I, O>
sourcepub fn head_input_mut(&mut self) -> Option<&mut I>
pub fn head_input_mut(&mut self) -> Option<&mut I>
Retrieve a unique reference to the input given by the head entry in the list, if there is one.
sourcepub fn init_and_wait<OnCancel>(
self,
input: I,
on_cancel: OnCancel
) -> InitAndWait<'wait_list, L, I, O, OnCancel>ⓘNotable traits for InitAndWait<'wait_list, L, I, O, OnCancel>impl<'wait_list, L: Lock, I, O, OnCancel> Future for InitAndWait<'wait_list, L, I, O, OnCancel> where
OnCancel: CancelCallback<'wait_list, L, I, O>, type Output = (LockedExclusive<'wait_list, L, I, O>, O); where
OnCancel: CancelCallback<'wait_list, L, I, O>,
pub fn init_and_wait<OnCancel>(
self,
input: I,
on_cancel: OnCancel
) -> InitAndWait<'wait_list, L, I, O, OnCancel>ⓘNotable traits for InitAndWait<'wait_list, L, I, O, OnCancel>impl<'wait_list, L: Lock, I, O, OnCancel> Future for InitAndWait<'wait_list, L, I, O, OnCancel> where
OnCancel: CancelCallback<'wait_list, L, I, O>, type Output = (LockedExclusive<'wait_list, L, I, O>, O); where
OnCancel: CancelCallback<'wait_list, L, I, O>,
OnCancel: CancelCallback<'wait_list, L, I, O>, type Output = (LockedExclusive<'wait_list, L, I, O>, O);
Wait on the list for someone to call Self::wake_one.
This method takes ownership of self so that the lock can be released while the future is
suspended. At the end, ownership of the lock guard is transferred back to the caller.
A callback must be supplied to call in the event that the future has been woken but was
cancelled before it could complete. You will often want to re-call Self::wake_one in
this case to pass on the notification to someone else.
Note that the returned future will not be Send if your guard types are !Send. To avoid
this problem, use the lower-level Wait API instead.
Methods from Deref<Target = LockedCommon<'wait_list, L, I, O>>
Trait Implementations
sourceimpl<'wait_list, L: Lock + Debug, I, O> Debug for LockedExclusive<'wait_list, L, I, O> where
<L as Lifetime<'wait_list>>::ExclusiveGuard: Debug,
impl<'wait_list, L: Lock + Debug, I, O> Debug for LockedExclusive<'wait_list, L, I, O> where
<L as Lifetime<'wait_list>>::ExclusiveGuard: Debug,
sourceimpl<'wait_list, L: Lock, I, O> Deref for LockedExclusive<'wait_list, L, I, O>
impl<'wait_list, L: Lock, I, O> Deref for LockedExclusive<'wait_list, L, I, O>
type Target = LockedCommon<'wait_list, L, I, O>
type Target = LockedCommon<'wait_list, L, I, O>
The resulting type after dereferencing.
Auto Trait Implementations
impl<'wait_list, L, I, O> !RefUnwindSafe for LockedExclusive<'wait_list, L, I, O>
impl<'wait_list, L, I, O> Send for LockedExclusive<'wait_list, L, I, O> where
I: Send + Sync,
L: Sync,
O: Send,
<L as Lifetime<'wait_list, Bounds<&'wait_list L>>>::ExclusiveGuard: Send,
impl<'wait_list, L, I, O> Sync for LockedExclusive<'wait_list, L, I, O> where
I: Send + Sync,
L: Sync,
O: Send,
<L as Lifetime<'wait_list, Bounds<&'wait_list L>>>::ExclusiveGuard: Sync,
impl<'wait_list, L, I, O> Unpin for LockedExclusive<'wait_list, L, I, O> where
<L as Lifetime<'wait_list, Bounds<&'wait_list L>>>::ExclusiveGuard: Unpin,
impl<'wait_list, L, I, O> !UnwindSafe for LockedExclusive<'wait_list, L, I, O>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more