pub struct ProcSem(/* private fields */);Expand description
Representation of a process that may be active or inactive.
Implementations§
Source§impl ProcSem
impl ProcSem
Sourcepub fn with_reporter(reporter: impl StateReporter + 'static) -> Self
pub fn with_reporter(reporter: impl StateReporter + 'static) -> Self
Create a new process semaphore with a reporter object.
Sourcepub fn acquire_async(&self) -> AcquireFuture ⓘ
pub fn acquire_async(&self) -> AcquireFuture ⓘ
Return a Future that will yield a ProcCtx when possible.
On successful acquire the internal endmsg will be cleared.
Sourcepub fn acquire_blocking(&self) -> ProcCtx
pub fn acquire_blocking(&self) -> ProcCtx
Acquire a ProcCtx, blocking until successful.
On successful acquire the internal endmsg will be cleared.
Sourcepub fn try_acquire(&self) -> Option<ProcCtx>
pub fn try_acquire(&self) -> Option<ProcCtx>
Attempt to acquire ProcCtx, returning immediately.
Returns Some(ProcCtx) if the lock was acquired successfully. Returns
None if the lock is already owned by another lock.
On successful acquire the internal endmsg will be cleared.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProcSem
impl !RefUnwindSafe for ProcSem
impl Send for ProcSem
impl Sync for ProcSem
impl Unpin for ProcSem
impl !UnwindSafe for ProcSem
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