Struct ThreadBuilder

pub struct ThreadBuilder { /* private fields */ }

Thread builder used for customization via [ThreadPoolBuilder::spawn_handler()].

Implementations

impl ThreadBuilder

fn index(&self) -> usize

Gets the index of this thread in the pool, within 0..num_threads.

fn name(&self) -> Option<&str>

Gets the string that was specified by ThreadPoolBuilder::name().

fn stack_size(&self) -> Option<usize>

Gets the value that was specified by ThreadPoolBuilder::stack_size().

fn run(self)

Executes the main loop for this thread. This will not return until the thread pool is dropped.

Trait Implementations

impl Debug for ThreadBuilder

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Auto Trait Implementations

impl !Freeze for ThreadBuilder

impl !RefUnwindSafe for ThreadBuilder

impl !Sync for ThreadBuilder

impl !UnwindSafe for ThreadBuilder

impl Send for ThreadBuilder

impl Unpin for ThreadBuilder

impl UnsafeUnpin for ThreadBuilder

Blanket Implementations

impl<T> Any for ThreadBuilder where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for ThreadBuilder where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for ThreadBuilder where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> From<T> for ThreadBuilder

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Pointable for ThreadBuilder

const ALIGN: usize = _;
type Init = T;
unsafe fn init(init: <T as Pointable>::Init) -> usize
unsafe fn deref<'a>(ptr: usize) -> &'a T
unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
unsafe fn drop(ptr: usize)

impl<T, U> Into<U> for ThreadBuilder where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for ThreadBuilder where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for ThreadBuilder where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>