Skip to main content

Envelope

Struct Envelope 

Source
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: String

ULID: lexicographically sortable, no coordination

§kind: String

task type name; the dispatch key

§schema_version: u32

payload versioning payload versioning — free now, impossible later

§payload: Vec<u8>

opaque to headgate; codec is the caller’s choice

§queue: String§partition_key: String

tenant fairness fair queuing (tenant/customer). “” = default partition

§rate_class: String

admission policy fleet-wide limiter bucket. “” = unlimited

§fingerprint: String

crash quarantine quarantine key: hash(kind, payload)

§attempt: u32

failures the handler RETURNED

§crash_attempt: u32

crash quarantine failures where the worker DIED. counted separately.

§max_attempts: u32§priority: i32

higher runs first within a queue

§enqueued_at_ms: i64

wire-time contract every duration and instant is milliseconds

§scheduled_at_ms: i64§timeout_ms: i64

per attempt

§deadline_ms: i64

absolute, across all attempts. 0 = none

§retention_ms: i64§unique_key: Vec<u8>

job uniqueness null = not unique

§unique_states: u32

bitmask of States uniqueness applies in

§headers: HashMap<String, String>§errors: Vec<AttemptError>§unique_window_ms: i64

job 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: u32

surveyed 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: String

Typed 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: u32

Request-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: i64

Trailing-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: bool

River-compatible uniqueness scope. false includes kind in the effective key; true deliberately coalesces equal keys across task kinds.

§tags: Vec<String>

Operator-indexed labels. Canonicalized by SDKs; never smuggled through headers.

§pending: bool

Insert durably without becoming admission-eligible until explicitly promoted.

§sticky_worker: String

Exact 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 Clone for Envelope

Source§

fn clone(&self) -> Envelope

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Envelope

Source§

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

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

impl Default for Envelope

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Message for Envelope

Source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
Source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
Source§

fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message to a buffer. Read more
Source§

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.
Source§

fn encode_length_delimited( &self, buf: &mut impl BufMut, ) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
Source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
Source§

fn decode(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes an instance of the message from a buffer. Read more
Source§

fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes a length-delimited instance of the message from the buffer.
Source§

fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
Source§

fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
Source§

impl PartialEq for Envelope

Source§

fn eq(&self, other: &Envelope) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Envelope

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

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.