pub struct Envelope {Show 32 fields
pub id: String,
pub kind: String,
pub schema_version: u32,
pub payload: Vec<u8>,
pub queue: String,
pub partition_key: String,
pub rate_class: String,
pub fingerprint: String,
pub attempt: u32,
pub crash_attempt: u32,
pub max_attempts: u32,
pub priority: i32,
pub enqueued_at_ms: i64,
pub scheduled_at_ms: i64,
pub timeout_ms: i64,
pub deadline_ms: i64,
pub retention_ms: i64,
pub unique_key: Vec<u8>,
pub unique_states: u32,
pub headers: HashMap<String, String>,
pub errors: Vec<AttemptError>,
pub unique_window_ms: i64,
pub checkpoint: Option<Checkpoint>,
pub weight: u32,
pub periodic_schedule_id: String,
pub periodic_tick_ms: i64,
pub unique_replace: u32,
pub unique_debounce_ms: i64,
pub unique_exclude_kind: bool,
pub tags: Vec<String>,
pub pending: bool,
pub sticky_worker: String,
}Fields§
§id: StringULID: lexicographically sortable, no coordination
kind: Stringtask type name; the dispatch key
schema_version: u32payload versioning payload versioning — free now, impossible later
payload: Vec<u8>opaque to headgate; codec is the caller’s choice
queue: String§partition_key: Stringtenant fairness fair queuing (tenant/customer). “” = default partition
rate_class: Stringadmission policy fleet-wide limiter bucket. “” = unlimited
fingerprint: Stringcrash quarantine quarantine key: hash(kind, payload)
attempt: u32failures the handler RETURNED
crash_attempt: u32crash quarantine failures where the worker DIED. counted separately.
max_attempts: u32§priority: i32higher runs first within a queue
enqueued_at_ms: i64wire-time contract every duration and instant is milliseconds
scheduled_at_ms: i64§timeout_ms: i64per attempt
deadline_ms: i64absolute, across all attempts. 0 = none
retention_ms: i64§unique_key: Vec<u8>job uniqueness null = not unique
unique_states: u32bitmask of States uniqueness applies in
headers: HashMap<String, String>§errors: Vec<AttemptError>§unique_window_ms: i64job uniqueness uniqueness mode. 0 = LIFECYCLE (one live job per key, released by terminal state). > 0 = THROTTLE (at most one per this many ms, released by the clock).
checkpoint: Option<Checkpoint>step replay step replay
weight: u32surveyed policy behavior estimated rate-budget cost. This is NOT queue-selection weight. Proto3’s omitted zero is normalized to the default 1 by every store; an ack may report an actual value (including zero) and atomically reconcile the estimate.
periodic_schedule_id: StringTyped durable periodic origin. Empty/zero means an ordinary enqueue; both fields are set together so clients never parse ids or opaque headers.
periodic_tick_ms: i64§unique_replace: u32Request-only bitmask for atomic replacement on a unique-key conflict. Allowed fields are defined by the language SDK constants; unknown bits are rejected.
unique_debounce_ms: i64Trailing-edge debounce. Requires unique_key and a positive millisecond window. The store schedules the holder at store-now + this window on both the first insert and every conflict; it never trusts a producer clock.
unique_exclude_kind: boolRiver-compatible uniqueness scope. false includes kind in the effective key; true deliberately coalesces equal keys across task kinds.
Operator-indexed labels. Canonicalized by SDKs; never smuggled through headers.
pending: boolInsert durably without becoming admission-eligible until explicitly promoted.
sticky_worker: StringExact stable worker identity allowed to claim this job. Empty means any worker. Enforced atomically by the store and retained across retry/reclaim transitions.
Trait Implementations§
Source§impl Message for Envelope
impl Message for Envelope
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.