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 Forget for Envelope
impl Freeze for Envelopewhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const SuggestionMessage is !null: Freeze,
PhantomData<SuggestionMessage>: Freeze,
*const CommandRequest is !null: Freeze,
PhantomData<CommandRequest>: Freeze,
PhantomData<SteeringInput>: Freeze,
PhantomData<InteractionRequest>: Freeze,
PhantomData<Value>: Freeze,
*const LeafNode<String, Value> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, Value)>>: Freeze,
PhantomData<String>: Freeze,
impl Move for Envelope
impl RefUnwindSafe for Envelope
impl Send for Envelope
impl Sync for Envelope
impl Unpin for Envelope
impl UnsafeUnpin for Envelopewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const SuggestionMessage is !null: UnsafeUnpin,
PhantomData<SuggestionMessage>: UnsafeUnpin,
*const CommandRequest is !null: UnsafeUnpin,
PhantomData<CommandRequest>: UnsafeUnpin,
PhantomData<SteeringInput>: UnsafeUnpin,
PhantomData<InteractionRequest>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
*const LeafNode<String, Value> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Value)>>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
impl UnwindSafe for Envelopewhere
RawVecInner: UnwindSafe,
BoxRaw<SuggestionMessage>: UnwindSafe,
BoxRaw<CommandRequest>: UnwindSafe,
BTreeMap<String, Value>: UnwindSafe,
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