Struct delay_timer::prelude::TaskInstance
source · pub struct TaskInstance { /* private fields */ }
Expand description
Public instance of task running.
Implementations§
source§impl TaskInstance
impl TaskInstance
sourcepub fn get_state(&self) -> InstanceState
pub fn get_state(&self) -> InstanceState
Get state of Instance.
sourcepub fn cancel_with_wait(&self) -> Result<InstanceState, TaskInstanceError>
pub fn cancel_with_wait(&self) -> Result<InstanceState, TaskInstanceError>
Cancel the currently running task instance and block the thread to wait.
sourcepub fn cancel_with_wait_timeout(
&self,
timeout: Duration
) -> Result<InstanceState, TaskInstanceError>
pub fn cancel_with_wait_timeout( &self, timeout: Duration ) -> Result<InstanceState, TaskInstanceError>
Cancel the currently running task instance and block the thread to wait for an expected amount of time.
sourcepub async fn cancel_with_async_wait(
&self
) -> Result<InstanceState, TaskInstanceError>
pub async fn cancel_with_async_wait( &self ) -> Result<InstanceState, TaskInstanceError>
Cancel the currently running task instance and async-await it.
Trait Implementations§
source§impl Clone for TaskInstance
impl Clone for TaskInstance
source§fn clone(&self) -> TaskInstance
fn clone(&self) -> TaskInstance
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl RefUnwindSafe for TaskInstance
impl Send for TaskInstance
impl Sync for TaskInstance
impl Unpin for TaskInstance
impl UnwindSafe for TaskInstance
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