pub struct Builder { /* private fields */ }
Expand description

Thread factory, which can be used in order to configure the properties of a new thread.

Implementations

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

Names the thread-to-be.

Sets the size of the stack (in bytes) for the new thread.

Sets the URL of wasm_bindgen generated shim script.

Spawns a new thread by taking ownership of the Builder, and returns an [io::Result] to its JoinHandle.

Spawns a new thread without any lifetime restrictions by taking ownership of the Builder, and returns an [io::Result] to its JoinHandle.

Safety

The caller has to ensure that no references in the supplied thread closure or its return type can outlive the spawned thread’s lifetime. This can be guaranteed in two ways:

  • ensure that join is called before any referenced data is dropped
  • use only types with 'static lifetime bounds, i.e., those with no or only 'static references (both Builder::spawn and spawn enforce this property statically)

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. 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.

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.