pub struct ExecutionServicesBuilder { /* private fields */ }Expand description
Builder for ExecutionServices.
The builder exposes blocking-pool options by delegating to
BlockingExecutorServiceBuilder and CPU-pool options by delegating to
RayonExecutorServiceBuilder. Tokio-backed domains are created with their
default constructors because they do not currently expose custom builders.
Implementations§
Source§impl ExecutionServicesBuilder
impl ExecutionServicesBuilder
Sourcepub fn blocking_pool_size(self, pool_size: usize) -> Self
pub fn blocking_pool_size(self, pool_size: usize) -> Self
Sourcepub fn blocking_core_pool_size(self, core_pool_size: usize) -> Self
pub fn blocking_core_pool_size(self, core_pool_size: usize) -> Self
Sourcepub fn blocking_maximum_pool_size(self, maximum_pool_size: usize) -> Self
pub fn blocking_maximum_pool_size(self, maximum_pool_size: usize) -> Self
Sourcepub fn blocking_queue_capacity(self, capacity: usize) -> Self
pub fn blocking_queue_capacity(self, capacity: usize) -> Self
Sourcepub fn blocking_unbounded_queue(self) -> Self
pub fn blocking_unbounded_queue(self) -> Self
Configures the blocking domain to use an unbounded queue.
§Returns
This builder for fluent configuration.
Sourcepub fn blocking_thread_name_prefix(self, prefix: &str) -> Self
pub fn blocking_thread_name_prefix(self, prefix: &str) -> Self
Sourcepub fn blocking_stack_size(self, stack_size: usize) -> Self
pub fn blocking_stack_size(self, stack_size: usize) -> Self
Sourcepub fn blocking_keep_alive(self, keep_alive: Duration) -> Self
pub fn blocking_keep_alive(self, keep_alive: Duration) -> Self
Sourcepub fn blocking_allow_core_thread_timeout(self, allow: bool) -> Self
pub fn blocking_allow_core_thread_timeout(self, allow: bool) -> Self
Sourcepub fn blocking_prestart_core_threads(self) -> Self
pub fn blocking_prestart_core_threads(self) -> Self
Sourcepub fn cpu_threads(self, num_threads: usize) -> Self
pub fn cpu_threads(self, num_threads: usize) -> Self
Sourcepub fn cpu_thread_name_prefix(self, prefix: &str) -> Self
pub fn cpu_thread_name_prefix(self, prefix: &str) -> Self
Sourcepub fn cpu_stack_size(self, stack_size: usize) -> Self
pub fn cpu_stack_size(self, stack_size: usize) -> Self
Sourcepub fn build(self) -> Result<ExecutionServices, ExecutionServicesBuildError>
pub fn build(self) -> Result<ExecutionServices, ExecutionServicesBuildError>
Builds the configured execution-services facade.
§Returns
Ok(ExecutionServices) if the blocking and CPU domains build
successfully.
§Errors
Returns ExecutionServicesBuildError if either the blocking or CPU
domain rejects its builder configuration.
Trait Implementations§
Source§impl Clone for ExecutionServicesBuilder
impl Clone for ExecutionServicesBuilder
Source§fn clone(&self) -> ExecutionServicesBuilder
fn clone(&self) -> ExecutionServicesBuilder
Returns a duplicate 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 moreSource§impl Debug for ExecutionServicesBuilder
impl Debug for ExecutionServicesBuilder
Auto Trait Implementations§
impl Freeze for ExecutionServicesBuilder
impl RefUnwindSafe for ExecutionServicesBuilder
impl Send for ExecutionServicesBuilder
impl Sync for ExecutionServicesBuilder
impl Unpin for ExecutionServicesBuilder
impl UnsafeUnpin for ExecutionServicesBuilder
impl UnwindSafe for ExecutionServicesBuilder
Blanket Implementations§
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more