pub struct LegacyMessage {
pub id: String,
pub topic: String,
pub payload: Vec<u8>,
pub sender: String,
pub metadata: HashMap<String, String>,
pub created_at: i64,
}Expand description
Legacy message structure (v0) for backward compatibility.
This is the original message format with binary payloads.
New code should use Message instead.
Fields§
§id: StringUnique message identifier (auto-generated UUID).
topic: StringMessage topic/type for routing or categorization.
payload: Vec<u8>Binary payload data.
sender: StringName of the sending agent.
metadata: HashMap<String, String>Arbitrary metadata key-value pairs.
created_at: i64Creation timestamp in microseconds since epoch.
Implementations§
Source§impl LegacyMessage
impl LegacyMessage
Sourcepub fn new(
topic: impl Into<String>,
payload: Vec<u8>,
sender: impl Into<String>,
) -> Self
pub fn new( topic: impl Into<String>, payload: Vec<u8>, sender: impl Into<String>, ) -> Self
Create a new legacy message.
Sourcepub fn correlation_id(&self) -> Option<String>
pub fn correlation_id(&self) -> Option<String>
Get the correlation ID for request/response tracking.
Sourcepub fn set_correlation_id(&mut self, id: &str)
pub fn set_correlation_id(&mut self, id: &str)
Set a correlation ID for request/response tracking.
Trait Implementations§
Source§impl Clone for LegacyMessage
impl Clone for LegacyMessage
Source§fn clone(&self) -> LegacyMessage
fn clone(&self) -> LegacyMessage
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 LegacyMessage
impl Debug for LegacyMessage
Source§impl<'de> Deserialize<'de> for LegacyMessage
impl<'de> Deserialize<'de> for LegacyMessage
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
Source§impl From<LegacyMessage> for Message
impl From<LegacyMessage> for Message
Source§fn from(legacy: LegacyMessage) -> Self
fn from(legacy: LegacyMessage) -> Self
Convert from legacy message format.
Source§impl Serialize for LegacyMessage
impl Serialize for LegacyMessage
Auto Trait Implementations§
impl Freeze for LegacyMessage
impl RefUnwindSafe for LegacyMessage
impl Send for LegacyMessage
impl Sync for LegacyMessage
impl Unpin for LegacyMessage
impl UnwindSafe for LegacyMessage
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