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.

Trait Implementations

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.