Struct maitake_sync::semaphore::Acquire
source · pub struct Acquire<'sem, Lock: RawMutex = Spinlock> { /* private fields */ }
Expand description
The future returned by the Semaphore::acquire
method.
Notes
This future is !Unpin
, as it is unsafe to core::mem::forget
an
Acquire
future once it has been polled. For instance, the following code
must not compile:
ⓘ
use maitake_sync::semaphore::Acquire;
// Calls to this function should only compile if `T` is `Unpin`.
fn assert_unpin<T: Unpin>() {}
assert_unpin::<Acquire<'_>>();
Trait Implementations§
impl<Lock: RawMutex> Sync for Acquire<'_, Lock>
impl<'pin, 'sem, Lock: RawMutex> Unpin for Acquire<'sem, Lock>where
__Acquire<'pin, 'sem, Lock>: Unpin,
Auto Trait Implementations§
impl<'sem, Lock = Spinlock> !RefUnwindSafe for Acquire<'sem, Lock>
impl<'sem, Lock> Send for Acquire<'sem, Lock>where
Lock: Sync,
impl<'sem, Lock = Spinlock> !UnwindSafe for Acquire<'sem, Lock>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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