Struct bounded_executor::BoundedExecutor[][src]

pub struct BoundedExecutor { /* fields omitted */ }

Implementations

Create a new BoundedExecutor from an existing tokio [Handle] with a maximum concurrent task capacity of capacity.

Spawn a Future on the BoundedExecutor. This function is async and will block if the executor is at capacity until one of the other spawned futures completes. This function returns a [JoinHandle] that the caller can .await on for the results of the Future.

Try to spawn a Future on the BoundedExecutor. If the BoundedExecutor is at capacity, this will return an Err(F), passing back the future the caller attempted to spawn. Otherwise, this will spawn the future on the executor and send back a [JoinHandle] that the caller can .await on for the results of the Future.

Like BoundedExecutor::spawn but spawns the given closure onto a blocking task (see [tokio::task::spawn_blocking] for details).

Like BoundedExecutor::try_spawn but spawns the given closure onto a blocking task (see [tokio::task::spawn_blocking] for details).

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. 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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.