pub struct WireEnvelope {Show 13 fields
pub protocol: String,
pub msg_id: MessageId,
pub msg_type: MsgType,
pub from_actor_id: ActorId,
pub to_actor_id: Option<ActorId>,
pub vision_id: Option<VisionId>,
pub project_id: Option<ProjectId>,
pub task_id: Option<TaskId>,
pub lamport_ts: u64,
pub created_at: OffsetDateTime,
pub expires_at: Option<OffsetDateTime>,
pub body: Value,
pub signature: MessageSignature,
}Expand description
A wire-format envelope where the body is untyped JSON for transport.
Fields§
§protocol: StringProtocol version string.
msg_id: MessageIdUnique message identifier.
msg_type: MsgTypeType discriminator for the body.
from_actor_id: ActorIdActor that created this message.
to_actor_id: Option<ActorId>Intended recipient actor, if directed.
vision_id: Option<VisionId>Associated vision, if any.
project_id: Option<ProjectId>Associated project, if any.
task_id: Option<TaskId>Associated task, if any.
lamport_ts: u64Lamport logical timestamp for causal ordering.
created_at: OffsetDateTimeWall-clock creation time.
expires_at: Option<OffsetDateTime>Optional expiration time for this message.
body: ValueUntyped JSON body for wire transport.
signature: MessageSignatureEd25519 signature over the canonical envelope content.
Implementations§
Source§impl WireEnvelope
impl WireEnvelope
Sourcepub fn decode<T>(self) -> Result<Envelope<T>, ProtocolError>where
T: RoutedBody + for<'de> Deserialize<'de>,
pub fn decode<T>(self) -> Result<Envelope<T>, ProtocolError>where
T: RoutedBody + for<'de> Deserialize<'de>,
Decodes the wire envelope’s JSON body into a typed Envelope.
Sourcepub fn verify_with_key(
&self,
verifying_key: &VerifyingKey,
) -> Result<(), ProtocolError>
pub fn verify_with_key( &self, verifying_key: &VerifyingKey, ) -> Result<(), ProtocolError>
Verifies the wire envelope’s signature against the given public key.
Trait Implementations§
Source§impl Clone for WireEnvelope
impl Clone for WireEnvelope
Source§fn clone(&self) -> WireEnvelope
fn clone(&self) -> WireEnvelope
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WireEnvelope
impl Debug for WireEnvelope
Source§impl<'de> Deserialize<'de> for WireEnvelope
impl<'de> Deserialize<'de> for WireEnvelope
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
Auto Trait Implementations§
impl Freeze for WireEnvelope
impl RefUnwindSafe for WireEnvelope
impl Send for WireEnvelope
impl Sync for WireEnvelope
impl Unpin for WireEnvelope
impl UnsafeUnpin for WireEnvelope
impl UnwindSafe for WireEnvelope
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