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
impl DispatchTicket
Sourcepub fn id(&self) -> u64
pub fn id(&self) -> u64
Returns this request’s identifier within Self::generation.
Sourcepub fn generation(&self) -> u64
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.
Sourcepub fn try_result(
&self,
) -> Option<Result<DispatchResult, DispatchCompletionError>>
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.
Sourcepub fn wait_timeout(
&self,
timeout: Duration,
) -> Result<DispatchResult, DispatchCompletionError>
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.
Sourcepub fn cancel(&self) -> DispatchCancelOutcome
pub fn cancel(&self) -> DispatchCancelOutcome
Attempts cancellation while the request has not committed to execution.