pub struct QueueMessage {
pub id: String,
pub topic: String,
pub payload: Value,
pub headers: HashMap<String, String>,
pub timestamp: DateTime<Utc>,
pub priority: u8,
pub correlation_id: Option<String>,
pub reply_to: Option<String>,
}Expand description
Message for queue communication.
Fields§
§id: StringUnique message ID.
topic: StringMessage topic/queue name.
payload: ValueMessage payload.
headers: HashMap<String, String>Message headers/metadata.
timestamp: DateTime<Utc>Message timestamp.
priority: u8Message priority (0-9, higher is more important).
correlation_id: Option<String>Correlation ID for request-response patterns.
reply_to: Option<String>Reply-to topic for response.
Implementations§
Source§impl QueueMessage
impl QueueMessage
Sourcepub fn with_correlation_id(self, correlation_id: impl Into<String>) -> Self
pub fn with_correlation_id(self, correlation_id: impl Into<String>) -> Self
Set message correlation ID.
Sourcepub fn with_reply_to(self, reply_to: impl Into<String>) -> Self
pub fn with_reply_to(self, reply_to: impl Into<String>) -> Self
Set reply-to topic.
Sourcepub fn with_priority(self, priority: u8) -> Self
pub fn with_priority(self, priority: u8) -> Self
Set message priority.
Trait Implementations§
Source§impl Clone for QueueMessage
impl Clone for QueueMessage
Source§fn clone(&self) -> QueueMessage
fn clone(&self) -> QueueMessage
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 moreSource§impl Debug for QueueMessage
impl Debug for QueueMessage
Source§impl<'de> Deserialize<'de> for QueueMessage
impl<'de> Deserialize<'de> for QueueMessage
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 QueueMessage
impl RefUnwindSafe for QueueMessage
impl Send for QueueMessage
impl Sync for QueueMessage
impl Unpin for QueueMessage
impl UnsafeUnpin for QueueMessage
impl UnwindSafe for QueueMessage
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