Skip to main content

CancelOperation

Struct CancelOperation 

Source
pub struct CancelOperation<'a, Admission = Waiting, Termination = TerminationUnbounded, Target = TaskTarget> { /* private fields */ }
Expand description

A task-cancellation operation with independent queue and termination-wait policy.

fail_fast changes only command-queue admission. termination_timeout changes only the later wait for logical terminal cleanup. The two settings can be applied in either order.

Implementations§

Source§

impl<'a, Termination, Target> CancelOperation<'a, Waiting, Termination, Target>

Source

pub fn fail_fast(self) -> CancelOperation<'a, FailFast, Termination, Target>

Immediate admission to the required management queue.

Source§

impl<'a, Admission, Target> CancelOperation<'a, Admission, TerminationUnbounded, Target>

Source

pub fn termination_timeout( self, wait_for: Duration, ) -> CancelOperation<'a, Admission, TerminationTimed, Target>

Deadline for this caller’s logical terminal-cleanup wait.

Queue admission and the cancellation claim are outside this deadline. A timeout does not undo an already committed cancellation.

Source§

impl<Target> CancelOperation<'_, Waiting, TerminationUnbounded, Target>
where Target: Into<TaskTarget>,

Source

pub async fn execute(self) -> Result<bool, RuntimeError>

Cancellation claim after waiting queue admission and logical terminal cleanup.

§Errors
Source§

impl<Target> CancelOperation<'_, FailFast, TerminationUnbounded, Target>
where Target: Into<TaskTarget>,

Source

pub async fn execute(self) -> Result<bool, RuntimeError>

Cancellation claim after immediate queue admission and unbounded terminal cleanup.

§Errors
Source§

impl<Target> CancelOperation<'_, Waiting, TerminationTimed, Target>
where Target: Into<TaskTarget>,

Source

pub async fn execute(self) -> Result<bool, RuntimeError>

Cancellation claim after waiting queue admission and bounded terminal cleanup.

§Errors
Source§

impl<Target> CancelOperation<'_, FailFast, TerminationTimed, Target>
where Target: Into<TaskTarget>,

Source

pub async fn execute(self) -> Result<bool, RuntimeError>

Cancellation claim after immediate queue admission and bounded terminal cleanup.

§Errors

Trait Implementations§

Source§

impl<Admission, Termination, Target> Debug for CancelOperation<'_, Admission, Termination, Target>
where Admission: Debug, Termination: Debug,

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, Admission = Waiting, Termination = TerminationUnbounded, Target = TaskTarget> !RefUnwindSafe for CancelOperation<'a, Admission, Termination, Target>

§

impl<'a, Admission = Waiting, Termination = TerminationUnbounded, Target = TaskTarget> !UnwindSafe for CancelOperation<'a, Admission, Termination, Target>

§

impl<'a, Admission, Termination, Target> Freeze for CancelOperation<'a, Admission, Termination, Target>
where Target: Freeze, Admission: Freeze, Termination: Freeze,

§

impl<'a, Admission, Termination, Target> Send for CancelOperation<'a, Admission, Termination, Target>
where Target: Send, Admission: Send, Termination: Send,

§

impl<'a, Admission, Termination, Target> Sync for CancelOperation<'a, Admission, Termination, Target>
where Target: Sync, Admission: Sync, Termination: Sync,

§

impl<'a, Admission, Termination, Target> Unpin for CancelOperation<'a, Admission, Termination, Target>
where Target: Unpin, Admission: Unpin, Termination: Unpin,

§

impl<'a, Admission, Termination, Target> UnsafeUnpin for CancelOperation<'a, Admission, Termination, Target>
where Target: UnsafeUnpin, Admission: UnsafeUnpin, Termination: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more