pub struct Lock<'a, T, L = DefaultMutex>where
L: ScopedRawMutex,
T: ?Sized,{ /* private fields */ }
Expand description
A future returned by the Mutex::lock
method.
§Notes
This future is !Unpin
, as it is unsafe to core::mem::forget
a
Lock
future once it has been polled. For instance, the following code
must not compile:
ⓘ
use maitake_sync::mutex::Lock;
// Calls to this function should only compile if `T` is `Unpin`.
fn assert_unpin<T: Unpin>() {}
assert_unpin::<Lock<'_, ()>>();
Trait Implementations§
source§impl<'a, T> Future for Lock<'a, T>
impl<'a, T> Future for Lock<'a, T>
§type Output = MutexGuard<'a, T>
type Output = MutexGuard<'a, T>
The type of value produced on completion.
impl<'pin, 'a, T, L> Unpin for Lock<'a, T, L>
Auto Trait Implementations§
impl<'a, T, L = DefaultMutex> !Freeze for Lock<'a, T, L>
impl<'a, T, L = DefaultMutex> !RefUnwindSafe for Lock<'a, T, L>
impl<'a, T, L> Send for Lock<'a, T, L>
impl<'a, T, L = DefaultMutex> !Sync for Lock<'a, T, L>
impl<'a, T, L = DefaultMutex> !UnwindSafe for Lock<'a, T, L>
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
§type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more