Struct blocking_permit::BlockingPermit [−][src]
pub struct BlockingPermit<'a> { /* fields omitted */ }
Expand description
A scoped permit for blocking operations. When dropped (out of scope or manually), the permit is released.
Implementations
Enter the blocking section of code on the current thread.
This is a secondary step from completion of the
BlockingPermitFuture
as it must be called on the same thread,
immediately before the blocking section. The blocking permit should
then be dropped at the end of the blocking section. If the
tokio-threaded feature is or might be used, run
should be
used instead.
Panics
Panics if this BlockingPermit
has already been entered.
Enter and run the blocking closure.
When the tokio-threaded feature is enabled, this wraps the
tokio::task::block_in_place
call, as a secondary step from completion
of the BlockingPermitFuture
that must be called on the same
thread.
In any case, the permit is passed by value and will be dropped on termination of this call.
Panics
Panics if this BlockingPermit
has already been entered.