[][src]Function blocking_permit::blocking_permit_future

pub fn blocking_permit_future(semaphore: &Semaphore) -> BlockingPermitFuture<'_>

Notable traits for BlockingPermitFuture<'a>

impl<'a> Future for BlockingPermitFuture<'a> type Output = Result<BlockingPermit<'a>, Canceled>;

Request a permit to perform a blocking operation on the current thread.

The returned future attempts to obtain a permit from the provided Semaphore and outputs a BlockingPermit which can then be run to allow blocking or "long running" operation, while the BlockingPermit remains in scope. If no permits are immediately available, then the current task context will be notified when one becomes available.