Struct zenoh_task::TerminatableTask
source · pub struct TerminatableTask { /* private fields */ }Implementations§
source§impl TerminatableTask
impl TerminatableTask
pub fn create_cancellation_token() -> CancellationToken
sourcepub fn spawn<F, T>(
rt: ZRuntime,
future: F,
token: CancellationToken,
) -> TerminatableTask
pub fn spawn<F, T>( rt: ZRuntime, future: F, token: CancellationToken, ) -> TerminatableTask
Spawns a task that can be later terminated by TerminatableTask::terminate().
Prior to termination attempt the specified cancellation token will be cancelled.
sourcepub fn spawn_abortable<F, T>(rt: ZRuntime, future: F) -> TerminatableTask
pub fn spawn_abortable<F, T>(rt: ZRuntime, future: F) -> TerminatableTask
Spawns a task that can be later aborted by TerminatableTask::terminate().
sourcepub fn terminate(self, timeout: Duration) -> bool
pub fn terminate(self, timeout: Duration) -> bool
Attempts to terminate the task. Returns true if task completed / aborted within timeout duration, false otherwise.
sourcepub async fn terminate_async(self, timeout: Duration) -> bool
pub async fn terminate_async(self, timeout: Duration) -> bool
Async version of TerminatableTask::terminate().
Auto Trait Implementations§
impl Freeze for TerminatableTask
impl RefUnwindSafe for TerminatableTask
impl Send for TerminatableTask
impl Sync for TerminatableTask
impl Unpin for TerminatableTask
impl UnwindSafe for TerminatableTask
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