Skip to main content

SuspendArgs

Struct SuspendArgs 

Source
#[non_exhaustive]
pub struct SuspendArgs { pub suspension_id: SuspensionId, pub waitpoints: Vec<WaitpointBinding>, pub resume_condition: ResumeCondition, pub resume_policy: ResumePolicy, pub reason_code: SuspensionReasonCode, pub requested_by: SuspensionRequester, pub timeout_at: Option<TimestampMs>, pub timeout_behavior: TimeoutBehavior, pub continuation_metadata_pointer: Option<String>, pub now: TimestampMs, pub idempotency_key: Option<IdempotencyKey>, }
Expand description

Trait-surface input to [EngineBackend::suspend] (RFC-013 §2.2 + RFC-014 Pattern 3 widening).

Built via SuspendArgs::new + with_* setters; direct struct- literal construction across crate boundaries is not possible (#[non_exhaustive]).

§Waitpoints

waitpoints is a non-empty Vec<WaitpointBinding>. The first entry is the “primary” binding (accessible via primary) and carries the current_waitpoint_id written onto exec_core for operator visibility. Additional entries land in Valkey as their own waitpoint hashes / signal streams / HMAC tokens, enabling RFC-014 Pattern 3 AllOf { members: [Single{wp1}, Single{wp2}, ...] } across distinct heterogeneous subsystems.

SuspendArgs::new takes exactly the primary binding; call with_waitpoint to append further bindings (the RFC-014 builder API).

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§suspension_id: SuspensionId§waitpoints: Vec<WaitpointBinding>

RFC-014 Pattern 3: all waitpoint bindings for this suspension. Guaranteed non-empty; waitpoints[0] is the primary.

§resume_condition: ResumeCondition§resume_policy: ResumePolicy§reason_code: SuspensionReasonCode§requested_by: SuspensionRequester§timeout_at: Option<TimestampMs>§timeout_behavior: TimeoutBehavior§continuation_metadata_pointer: Option<String>§now: TimestampMs§idempotency_key: Option<IdempotencyKey>

Implementations§

Source§

impl SuspendArgs

Source

pub fn new( suspension_id: SuspensionId, waitpoint: WaitpointBinding, resume_condition: ResumeCondition, resume_policy: ResumePolicy, reason_code: SuspensionReasonCode, now: TimestampMs, ) -> Self

Build a minimal SuspendArgs for a worker-originated suspension.

waitpoint becomes the primary binding. Append additional bindings with with_waitpoint (RFC-014 Pattern 3) or replace the set with with_waitpoints.

Defaults: requested_by = Worker, timeout_at = None, timeout_behavior = Fail, continuation_metadata_pointer = None, idempotency_key = None.

Source

pub fn primary(&self) -> &WaitpointBinding

Primary binding — waitpoints[0]. Guaranteed present by construction.

Source

pub fn with_timeout(self, at: TimestampMs, behavior: TimeoutBehavior) -> Self

Source

pub fn with_requester(self, requester: SuspensionRequester) -> Self

Source

pub fn with_continuation_metadata_pointer(self, p: String) -> Self

Source

pub fn with_idempotency_key(self, key: IdempotencyKey) -> Self

Source

pub fn with_waitpoint(self, binding: WaitpointBinding) -> Self

RFC-014 Pattern 3 — append a further waitpoint binding to this suspension. Each additional binding yields its own waitpoint hash, signal stream, condition hash and HMAC token in Valkey, but all share the suspension record and composite evaluator under one suspension:current.

Ordering: the primary (from SuspendArgs::new) stays at waitpoints[0]; subsequent with_waitpoint calls append at the tail.

Source

pub fn with_waitpoints(self, bindings: Vec<WaitpointBinding>) -> Self

RFC-014 Pattern 3 — replace the full binding vector in one call. Must be non-empty; an empty Vec is a programmer error and will be rejected by the backend’s validate_suspend_args with waitpoints_empty.

Trait Implementations§

Source§

impl Clone for SuspendArgs

Source§

fn clone(&self) -> SuspendArgs

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SuspendArgs

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for SuspendArgs

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for SuspendArgs

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,