pub trait TaskContext {
// Required methods
fn set_workers(&self, max: usize);
fn set_worker_stack_size(&self, stack_size: usize);
fn workers(&self) -> usize;
fn create_task(&self, f: TaskFut) -> ComHandle ⓘ;
}Expand description
The trait implemented by the context.
This trait is used by [TaskBuilder] to create new tasks, as well as to increase the capacity of workers.
This trait is not object safe.
Required Methods§
Sourcefn set_workers(&self, max: usize)
fn set_workers(&self, max: usize)
Sets the amount of concurrent workers. The amount of workers can only ever increase. If you set the limit, then set it again to a lower limit, the limit will not change.
Sourcefn set_worker_stack_size(&self, stack_size: usize)
fn set_worker_stack_size(&self, stack_size: usize)
Sets the amount of available stack size per worker.
Sourcefn create_task(&self, f: TaskFut) -> ComHandle ⓘ
fn create_task(&self, f: TaskFut) -> ComHandle ⓘ
Creates an asynchronous task used by handle traits inside of task.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".