pub struct Builder<'a> { /* private fields */ }Expand description
An ergonomic builder for tasks. Alternatively you can use spawn.
Implementations§
source§impl<'a> Builder<'a>
impl<'a> Builder<'a>
sourcepub const fn name(self, name: &'a str) -> Self
pub const fn name(self, name: &'a str) -> Self
Sets the name of the task, this is useful for debugging.
sourcepub const fn priority(self, priority: TaskPriority) -> Self
pub const fn priority(self, priority: TaskPriority) -> Self
Sets the priority of the task (how much time the scheduler gives to it.).
sourcepub const fn stack_depth(self, stack_depth: TaskStackDepth) -> Self
pub const fn stack_depth(self, stack_depth: TaskStackDepth) -> Self
Sets how large the stack for the task is. This can usually be set to default
sourcepub fn spawn<F>(self, function: F) -> Result<TaskHandle, SpawnError>
pub fn spawn<F>(self, function: F) -> Result<TaskHandle, SpawnError>
Builds and spawns the task
Trait Implementations§
Auto Trait Implementations§
impl<'a> RefUnwindSafe for Builder<'a>
impl<'a> Send for Builder<'a>
impl<'a> Sync for Builder<'a>
impl<'a> Unpin for Builder<'a>
impl<'a> UnwindSafe for Builder<'a>
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