pub struct MessageData {
pub content: String,
pub properties: Option<HashMap<String, String>>,
}Expand description
Data structure for message content and metadata.
Represents a message to be sent to a Service Bus queue, including the message content and optional custom properties. Used for sending new messages and representing message data in transit.
§Examples
use quetty_server::service_bus_manager::MessageData;
use std::collections::HashMap;
// Simple message with just content
let message = MessageData::new("Hello, world!".to_string());
// Message with custom properties
let mut properties = HashMap::new();
properties.insert("priority".to_string(), "high".to_string());
properties.insert("source".to_string(), "orders-service".to_string());
let message = MessageData::with_properties(
"Order processed: #12345".to_string(),
properties
);Fields§
§content: StringThe message content/body
properties: Option<HashMap<String, String>>Optional custom properties for the message
Implementations§
Trait Implementations§
Source§impl Clone for MessageData
impl Clone for MessageData
Source§fn clone(&self) -> MessageData
fn clone(&self) -> MessageData
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 MessageData
impl Debug for MessageData
Source§impl<'de> Deserialize<'de> for MessageData
impl<'de> Deserialize<'de> for MessageData
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 MessageData
impl RefUnwindSafe for MessageData
impl Send for MessageData
impl Sync for MessageData
impl Unpin for MessageData
impl UnwindSafe for MessageData
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