pub struct Envelope {
pub metadata: Metadata,
pub payload: Payload,
}Expand description
Complete transport message.
Fields§
§metadata: MetadataCorrelation and version metadata.
payload: PayloadTyped payload.
Implementations§
Source§impl Envelope
impl Envelope
Sourcepub fn decode_json(input: &str) -> Result<Self, ProtocolError>
pub fn decode_json(input: &str) -> Result<Self, ProtocolError>
Decodes a JSON envelope against the protocol types.
Transport adapters should use this entry point rather than calling serde_json directly.
Unknown keys are rejected. Canonical emit omits skip-optional None; an explicit null on
those keys is accepted as absent so accept follows the types instead of a serialize roundtrip.
§Errors
Returns ProtocolError for malformed JSON, unknown fields, or failed envelope validation.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Envelope
impl<'de> Deserialize<'de> for Envelope
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>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Envelope
Auto Trait Implementations§
impl Freeze for Envelope
impl RefUnwindSafe for Envelope
impl Send for Envelope
impl Sync for Envelope
impl Unpin for Envelope
impl UnsafeUnpin for Envelope
impl UnwindSafe for Envelope
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