Skip to main content

DispatchTicket

Struct DispatchTicket 

Source
pub struct DispatchTicket { /* private fields */ }
Expand description

An owned request handle containing no Excel pointer or callback capability.

Dropping a ticket detaches it: queued work remains owned by its generation and is eventually executed, canceled, expired, or retired by shutdown.

Implementations§

Source§

impl DispatchTicket

Source

pub fn id(&self) -> u64

Returns this request’s identifier within Self::generation.

Source

pub fn generation(&self) -> u64

Returns the dispatcher generation that owns this request.

IDs can be reused by a later generation, so interpret them together.

Source

pub fn try_result( &self, ) -> Option<Result<DispatchResult, DispatchCompletionError>>

Returns a copied terminal result if available without blocking.

Polling also cooperatively expires this request if it is still queued.

Source

pub fn wait_timeout( &self, timeout: Duration, ) -> Result<DispatchResult, DispatchCompletionError>

Waits until completion, the caller deadline, or a queued request deadline.

The earlier of timeout and the request deadline wins while the request is queued. A caller timeout does not cancel the request. Waiting from an Excel callback is rejected to avoid blocking Excel; ticket drop detaches rather than cancels the generation-owned request.

Source

pub fn cancel(&self) -> DispatchCancelOutcome

Attempts cancellation while the request has not committed to execution.

Trait Implementations§

Source§

impl Debug for DispatchTicket

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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, 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, !>

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.