Struct email::thread_pool::ThreadPoolBuilder
source · pub struct ThreadPoolBuilder<B: ThreadPoolContextBuilder> {
ctx_builder: B,
size: usize,
}
Expand description
The thread pool builder.
Builder that help you to create a ThreadPool
.
Fields§
§ctx_builder: B
The context builder.
size: usize
The size of the pool.
Represents the number of threads that will be spawn in parallel. Defaults to 8.
Implementations§
source§impl<B: ThreadPoolContextBuilder + 'static> ThreadPoolBuilder<B>
impl<B: ThreadPoolContextBuilder + 'static> ThreadPoolBuilder<B>
sourcepub fn set_some_size(&mut self, size: Option<usize>)
pub fn set_some_size(&mut self, size: Option<usize>)
Change the thread pool size.
sourcepub fn with_some_size(self, size: Option<usize>) -> Self
pub fn with_some_size(self, size: Option<usize>) -> Self
Change the thread pool size using the builder pattern.
sourcepub fn with_size(self, size: usize) -> Self
pub fn with_size(self, size: usize) -> Self
Change the thread pool size using the builder pattern.
sourcepub async fn build(self) -> Result<ThreadPool<B::Context>>
pub async fn build(self) -> Result<ThreadPool<B::Context>>
Build the final thread pool.
Trait Implementations§
source§impl<B: Clone + ThreadPoolContextBuilder> Clone for ThreadPoolBuilder<B>
impl<B: Clone + ThreadPoolContextBuilder> Clone for ThreadPoolBuilder<B>
source§fn clone(&self) -> ThreadPoolBuilder<B>
fn clone(&self) -> ThreadPoolBuilder<B>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<B> Freeze for ThreadPoolBuilder<B>
impl<B> RefUnwindSafe for ThreadPoolBuilder<B>
impl<B> Send for ThreadPoolBuilder<B>
impl<B> Sync for ThreadPoolBuilder<B>
impl<B> Unpin for ThreadPoolBuilder<B>
impl<B> UnwindSafe for ThreadPoolBuilder<B>
Blanket Implementations§
source§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
source§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
source§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
The error type produced by a failed conversion.
source§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
source§impl<T> ConvUtil for T
impl<T> ConvUtil for T
source§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Approximate the subject to a given type with the default scheme.
source§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
Approximate the subject to a given type with a specific scheme.