pub struct Message {
pub body: Bytes,
pub attributes: HashMap<String, String>,
pub session_id: Option<SessionId>,
pub correlation_id: Option<String>,
pub time_to_live: Option<Duration>,
}Expand description
A message to be sent through the queue system
Fields§
§body: Bytes§attributes: HashMap<String, String>§session_id: Option<SessionId>§correlation_id: Option<String>§time_to_live: Option<Duration>Implementations§
Source§impl Message
impl Message
Sourcepub fn with_session_id(self, session_id: SessionId) -> Self
pub fn with_session_id(self, session_id: SessionId) -> Self
Add session ID for ordered processing
Sourcepub fn with_attribute(self, key: String, value: String) -> Self
pub fn with_attribute(self, key: String, value: String) -> Self
Add message attribute
Sourcepub fn with_correlation_id(self, correlation_id: String) -> Self
pub fn with_correlation_id(self, correlation_id: String) -> Self
Add correlation ID for tracking
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Message
impl<'de> Deserialize<'de> for Message
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 Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnsafeUnpin for Message
impl UnwindSafe for Message
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