Struct entangled::ThreadPoolDescriptor[][src]

pub struct ThreadPoolDescriptor {
    pub num_threads: usize,
    pub stack_size: usize,
    pub thread_name: String,
    pub start_handler: Option<Box<dyn Fn(usize) + Send + Sync>>,
    pub exit_handler: Option<Box<dyn Fn(usize) + Send + Sync>>,
}

Describes how a ThreadPool should be created.

Fields

num_threads: usize

Spawns at most n threads for the thread pool. Default: 2.

stack_size: usize

The stack size of the spawned threads. Default: 2 MiB.

thread_name: String

Name of the threads. Threads will be named: {thread_name} ({thread index}), i.e. “Thread pool (0)” Default: “Thread pool”

start_handler: Option<Box<dyn Fn(usize) + Send + Sync>>

Closure invoked on worker thread start. Closure parameter contains the index of the created thread. Default: None

exit_handler: Option<Box<dyn Fn(usize) + Send + Sync>>

Closure invoked on worker thread exit. Closure parameter contains the index of the created thread. Default: None

Trait Implementations

impl Default for ThreadPoolDescriptor[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.