Struct pond::Scope

source ·
pub struct Scope<'pool, 'scope> { /* private fields */ }
Expand description

Represents the current scope, you can execute functions in it.

Implementations

Give each of the threads a state

The parameter is a closure that is run in each thread. The parameter finishes running before this function exits.

A new scope is returned that allows one to run jobs in the worker threads which can take the state parameter.

Execute a job on one of the threads in the threadpool.

The closure is called from one of the threads. If the threadpool has a specified backlog, then this function blocks until the threadpool finishes a job.

This function may panic if a job that was previously executed has panicked. This way, your program terminates as soon as a panic occurs. If you don’t call this function again after a panic occurs, then Pool::scoped will panic before it completes.

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.