pub struct HandlerInput {
pub run_id: RunId,
pub attempt_id: AttemptId,
pub payload: Vec<u8>,
pub metadata: AttemptMetadata,
pub cancellation_context: CancellationContext,
}Expand description
Execution context provided to the handler for each attempt.
This structure contains all information needed to execute an attempt including the run and attempt identifiers, the payload to execute, and constraints snapshot for timeout and retry behavior.
§Cancellation contract
- If
metadata.timeout_secsisSome, timeout enforcement may request cancellation while execution is in progress. - Long-running handlers must poll
CancellationToken::is_cancelled()at bounded intervals and exit promptly once cancellation is observed. - Returning success after cancellation has been requested does not override timeout truth; timeout classification remains authoritative.
Fields§
§run_id: RunIdThe unique identifier for the run instance.
attempt_id: AttemptIdThe unique identifier for this specific attempt within the run.
payload: Vec<u8>The opaque payload bytes to execute.
metadata: AttemptMetadataThe attempt-level execution metadata (timeout, retry policy, etc.).
cancellation_context: CancellationContextThe cancellation context for this execution. Handlers can check this to determine if execution should be terminated early.
Trait Implementations§
Source§impl Clone for HandlerInput
impl Clone for HandlerInput
Source§fn clone(&self) -> HandlerInput
fn clone(&self) -> HandlerInput
Returns a duplicate 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 Freeze for HandlerInput
impl RefUnwindSafe for HandlerInput
impl Send for HandlerInput
impl Sync for HandlerInput
impl Unpin for HandlerInput
impl UnsafeUnpin for HandlerInput
impl UnwindSafe for HandlerInput
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