Struct std::thread::BuilderStable [-]  [+] [src]

pub struct Builder {
    // some fields omitted
}

Thread configuration. Provides detailed control over the properties and behavior of new threads.

Methods

impl Builder

fn new() -> Builder

Generate the base configuration for spawning a thread, from which configuration methods can be chained.

fn name(self, name: String) -> Builder

Name the thread-to-be. Currently the name is used for identification only in panic messages.

fn stack_size(self, size: usize) -> Builder

Set the size of the stack for the new thread.

fn stdout(self, stdout: Box<Writer + Send>) -> Builder

Redirect thread-local stdout.

fn stderr(self, stderr: Box<Writer + Send>) -> Builder

Redirect thread-local stderr.

fn spawn<F>(self, f: F) -> Thread where F: FnOnce(), F: Send + 'static

Spawn a new detached thread, and return a handle to it.

See Thead::spawn and the module doc for more details.

fn scoped<'a, T, F>(self, f: F) -> JoinGuard<'a, T> where T: Send + 'a, F: FnOnce() -> T, F: Send + 'a

Spawn a new child thread that must be joined within a given scope, and return a JoinGuard.

See Thead::scoped and the module doc for more details.