pub struct DispatchEnvelope {
pub schema_version: String,
pub request: CallbackRequest,
pub payloads: Vec<PayloadEnvelope>,
}Expand description
Wire shape carrying a CallbackRequest and the opaque
PayloadEnvelope bodies a dispatch is delivering with.
The lifecycle contract distinguishes two concerns:
- the request a client receives describing what is happening
(event kind, frame context,
CallbackRequest::payload_refspointing at named/sized/digested payloads), and - the envelope bodies the request refers to.
Until issue #22 the CLI and the subprocess invoker only transported
the request — the envelopes were not delivered, so subprocess clients
could not reach payload bodies and negotiation never saw real
placement inputs. DispatchEnvelope is the transport-boundary shape
that carries both:
{
"schema_version": "lifeloop.v0.1",
"request": { "...CallbackRequest...": "..." },
"payloads": [ { "...PayloadEnvelope...": "..." } ]
}Lifeloop does not parse payloads[].body — it is transported
verbatim, consistent with the spec rule that bodies are opaque
(docs/specs/lifecycle-contract/body.md, “Opaque Payload Envelope”).
payloads is omitted on the wire when empty.
Fields§
§schema_version: String§request: CallbackRequest§payloads: Vec<PayloadEnvelope>Implementations§
Source§impl DispatchEnvelope
impl DispatchEnvelope
Sourcepub fn new(request: CallbackRequest, payloads: Vec<PayloadEnvelope>) -> Self
pub fn new(request: CallbackRequest, payloads: Vec<PayloadEnvelope>) -> Self
Construct a dispatch envelope at the canonical schema version.
Sourcepub fn validate(&self) -> Result<(), ValidationError>
pub fn validate(&self) -> Result<(), ValidationError>
Validate the envelope: schema version, the inner request, and
each carried payload. Cross-correlation between
request.payload_refs and payloads[] is intentionally not
enforced here — a request may declare refs that are delivered
out-of-band, and clients may receive bodies the request did not
list (e.g. degraded fallback bodies). Cross-correlation belongs
in negotiation/receipt synthesis, not the transport boundary.
Trait Implementations§
Source§impl Clone for DispatchEnvelope
impl Clone for DispatchEnvelope
Source§fn clone(&self) -> DispatchEnvelope
fn clone(&self) -> DispatchEnvelope
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DispatchEnvelope
impl Debug for DispatchEnvelope
Source§impl<'de> Deserialize<'de> for DispatchEnvelope
impl<'de> Deserialize<'de> for DispatchEnvelope
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for DispatchEnvelope
impl PartialEq for DispatchEnvelope
Source§fn eq(&self, other: &DispatchEnvelope) -> bool
fn eq(&self, other: &DispatchEnvelope) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for DispatchEnvelope
impl Serialize for DispatchEnvelope
impl Eq for DispatchEnvelope
impl StructuralPartialEq for DispatchEnvelope
Auto Trait Implementations§
impl Freeze for DispatchEnvelope
impl RefUnwindSafe for DispatchEnvelope
impl Send for DispatchEnvelope
impl Sync for DispatchEnvelope
impl Unpin for DispatchEnvelope
impl UnsafeUnpin for DispatchEnvelope
impl UnwindSafe for DispatchEnvelope
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.