Struct itron_solid_asp3::task::Builder [−][src]
pub struct Builder<Start, Stack, InitialPriority> { /* fields omitted */ }
This is supported on crate features
unstable
and dcre
only.Expand description
The builder type for tasks. Created by Task::build
.
Its generic parameters are an implementation detail.
Implementations
(Mandatory) Specify the entry point.
(Mandatory) Specify to use an automatically allocated stack region of the specified size.
(Mandatory) Specify the initial priority.
Specify the task’s initial assigned processor. Defaults to the current processor when unspecified.
Specify the task’s assignable processsor set. Defaults to all processors when unspecified.
This function might panic if an invalid processor ID is specified or the set is empty.
Examples
#![feature(const_option)]
use itron::{task::Task, processor::Processor};
let processor = itron::processor::current().unwrap();
let task = Task::build()
.start(move || {})
.stack_size(4096)
.initial_priority(4)
.initial_processor(processor)
.processor_affinity([processor])
.finish()
.expect("failed to create a task");
Create a task using the specified parameters.
Create and activate a task using the specified parameters.