Skip to main content

ExecutorBuilder

Struct ExecutorBuilder 

Source
pub struct ExecutorBuilder { /* private fields */ }
Expand description

Builder for creating executors with custom configuration.

Implementations§

Source§

impl ExecutorBuilder

Source

pub fn new() -> Self

Creates a new executor builder with default settings.

§Returns

A new builder instance ready for configuration

Source

pub fn worker_threads(self, count: usize) -> Self

Sets the number of worker threads for CPU-bound tasks.

§Arguments
  • count - Number of worker threads to create
§Returns

The builder instance for method chaining

Source

pub fn worker_placement(self, placement: WorkerPlacement) -> Self

Sets whether each worker is confined to one logical processor.

§Arguments
  • placement - The worker placement policy
§Returns

The builder instance for method chaining

Source

pub fn async_threads(self, count: usize) -> Self

Sets the number of threads for async task execution.

§Arguments
  • count - Number of async threads to create
§Returns

The builder instance for method chaining

Source

pub fn max_global_queue_size(self, size: usize) -> Self

Sets the aggregate maximum of the workers’ external admission queues.

§Arguments
  • size - Maximum queued tasks across all worker injectors
§Returns

The builder instance for method chaining

Source

pub fn local_queue_initial_capacity(self, size: usize) -> Self

Sets the initial capacity of each resizable local priority queue.

§Arguments
  • size - Requested initial slots per local priority queue
§Returns

The builder instance for method chaining

Source

pub fn thread_name_prefix(self, prefix: impl Into<String>) -> Self

Sets the thread name prefix for executor threads.

§Arguments
  • prefix - String prefix for thread names
§Returns

The builder instance for method chaining

Source

pub fn preemption_config(self, config: PreemptionConfig) -> Self

Configures preemption behavior for the executor.

§Arguments
  • config - Preemption configuration settings
§Returns

The builder instance for method chaining

Source

pub fn memory_config(self, config: MemoryConfig) -> Self

Configures memory management settings.

§Arguments
  • config - Memory configuration settings
§Returns

The builder instance for method chaining

Source

pub fn cleanup_config(self, config: CleanupConfig) -> Self

Configures cleanup and maintenance settings.

§Arguments
  • config - Cleanup configuration settings
§Returns

The builder instance for method chaining

Trait Implementations§

Source§

impl Default for ExecutorBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

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

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.