pub struct TaskBuilder { /* private fields */ }
Expand description
Builder to create a new task
Implementations§
Source§impl TaskBuilder
impl TaskBuilder
Sourcepub fn new(name: impl Into<Cow<'static, str>>) -> Self
pub fn new(name: impl Into<Cow<'static, str>>) -> Self
Start the construction of a new task with the given name
Sourcepub fn set_run_token(self, run_token: RunToken) -> Self
pub fn set_run_token(self, run_token: RunToken) -> Self
Set the run_token for the task. It is sometimes nessesary to know the run_token of a task before it is created
Sourcepub fn abort(self) -> Self
pub fn abort(self) -> Self
Cancel the task by dropping the future, instead of only setting the cancel token
Sourcepub fn no_shutdown(self) -> Self
pub fn no_shutdown(self) -> Self
Keep the task running on shutdown
Sourcepub fn shutdown_order(self, shutdown_order: i32) -> Self
pub fn shutdown_order(self, shutdown_order: i32) -> Self
Tasks with a lower shutdown order are stopped earlier on shutdown
Auto Trait Implementations§
impl Freeze for TaskBuilder
impl RefUnwindSafe for TaskBuilder
impl Send for TaskBuilder
impl Sync for TaskBuilder
impl Unpin for TaskBuilder
impl UnwindSafe for TaskBuilder
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