pub struct RandomsBatch {
    pub id: usize,
    pub contained_random_ids: Vec<usize>,
    pub id_provider: SizedIdProvider,
    pub randoms_thread_pool: Arc<ThreadPool<Randoms>>,
}
Expand description

An example of an element that contains a child thread pool

RandomsBatches and Randoms form a hierarchy. A RandomsBatch contains many Randoms.

RandomsBatches are managed by a one thread pool and internally they have a collection of Randoms which are managed in a separate “child” thread pool In this example all of the Randoms share a single thread pool regardless of which RandomsBatch created them

For this reason the RandomsBatches need to share an id_provider which provides globally unique ids (ids, must be unique across the thread pool for obvious reasons)

Fields§

§id: usize§contained_random_ids: Vec<usize>§id_provider: SizedIdProvider§randoms_thread_pool: Arc<ThreadPool<Randoms>>

Implementations§

Trait Implementations§

Formats the value using the given formatter. Read more
This is a struct that defines the message that will initiate a new instance of the struct within the thread pool Read more
This is the enum that will define that messaging api that can be used to communicate with instances of the struct It will be an enum where each variant will define a request/response pair of structs Read more
This is the function that will define how the struct processes the messages that it receives. It will typically consist of a match statement that will discriminate amongst the various messages type defined in the Api Read more
This function defines how a new struct will be created when it receives The Init message. It returns the created new instance of the struct Read more
This function is a hook that is called when the pool is shutting down.
The function called if an item with the specified is not found The default behaviour is to panic Read more
used for debug only; allows logging to output the name of the type
This method is called to optionally add tracing before each message is processed. The tracing is removed once the message is processed. If the tracing is being written to a file it is important that the file is not truncated Read more
This method provides any required tracing in the pool items thread pool threads This tracing is added when the thread is spawned and remains in place until the thread dies 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

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

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.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more