pub struct TaskPool<F: Future + 'static, const N: usize> { /* private fields */ }
Expand description

Raw storage that can hold up to N tasks of the same type.

This is essentially a [TaskStorage<F>; N].

Implementations

Create a new TaskPool, with all tasks in non-spawned state.

Try to spawn a task in the pool.

See TaskStorage::spawn() for details.

This will loop over the pool and spawn the task in the first storage that is currently free. If none is free, a “poisoned” SpawnToken is returned, which will cause Spawner::spawn() to return the error.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.