A thread builder.
Use this struct to customize the way a thread is spawned.
Methods
impl Builder { ... }
-
fn new() -> Builder
Create a new default Builder instance.
-
Whether panics should be caught by the thread.
This is relevant only for threads that are created in joinable state. When a detached thread panics, the process will terminate.
-
Sets the size of the stack for the new thread.
The stack size is specified in bytes.
-
fn spawn<T, F>(self: &Builder, func: F) -> Result<JoinHandle<T>, Error>
F: Fn() -> TSpawn a thread in joinable state.
-
Spawn a thread in detached state.