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>
Strictly decodes a JSON envelope and rejects fields unknown to the Rust DTO graph.
Transport adapters should use this entry point rather than calling serde_json directly.
§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