pub struct Task(/* private fields */);Expand description
A Task operating on a threadshare Context.
Implementations§
Source§impl Task
impl Task
pub fn state(&self) -> TaskState
pub fn lock_state(&self) -> TaskStateGuard<'_>
pub fn prepare( &self, task_impl: impl TaskImpl, context: Context, ) -> TransitionStatus ⓘ
pub fn unprepare(&self) -> TransitionStatus ⓘ
Sourcepub fn start(&self) -> TransitionStatus ⓘ
pub fn start(&self) -> TransitionStatus ⓘ
Starts the Task.
The execution occurs on the Task context.
Sourcepub fn pause(&self) -> TransitionStatus ⓘ
pub fn pause(&self) -> TransitionStatus ⓘ
Requests the Task loop to pause.
If an item handling is in progress, it will run to completion,
then no iterations will be executed before start is called again.
pub fn flush_start(&self) -> TransitionStatus ⓘ
pub fn flush_stop(&self) -> TransitionStatus ⓘ
Sourcepub fn stop(&self) -> TransitionStatus ⓘ
pub fn stop(&self) -> TransitionStatus ⓘ
Stops the Started Task and wait for it to finish.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Task
impl RefUnwindSafe for Task
impl Send for Task
impl Sync for Task
impl Unpin for Task
impl UnsafeUnpin for Task
impl UnwindSafe for Task
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more