pub struct MessageEnvelope {
pub from: String,
pub to: String,
pub message: AgentMessage,
pub timestamp: SystemTime,
}Expand description
Envelope containing message metadata
Fields§
§from: StringSender agent ID.
to: StringRecipient agent ID.
message: AgentMessageThe message payload.
timestamp: SystemTimeWhen the message was created.
Implementations§
Source§impl MessageEnvelope
impl MessageEnvelope
Sourcepub fn new(from: String, to: String, message: AgentMessage) -> Self
pub fn new(from: String, to: String, message: AgentMessage) -> Self
Create a new message envelope with the current timestamp.
Trait Implementations§
Source§impl Clone for MessageEnvelope
impl Clone for MessageEnvelope
Source§fn clone(&self) -> MessageEnvelope
fn clone(&self) -> MessageEnvelope
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MessageEnvelope
impl RefUnwindSafe for MessageEnvelope
impl Send for MessageEnvelope
impl Sync for MessageEnvelope
impl Unpin for MessageEnvelope
impl UnsafeUnpin for MessageEnvelope
impl UnwindSafe for MessageEnvelope
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