pub struct OwnedMessage { /* private fields */ }Expand description
A message the application keeps: Message::to_owned, or what the
Events stream yields.
Implementations§
Source§impl OwnedMessage
impl OwnedMessage
Sourcepub fn correlation_id(&self) -> Option<&str>
pub fn correlation_id(&self) -> Option<&str>
The correlation id (cid).
Sourcepub fn payload<'a, T: Deserialize<'a>>(&'a self) -> Result<T, Error>
pub fn payload<'a, T: Deserialize<'a>>(&'a self) -> Result<T, Error>
The payload (p) decoded into T.
Sourcepub fn payload_json(&self) -> Option<&str>
pub fn payload_json(&self) -> Option<&str>
The payload’s JSON text, on a JSON connection.
Sourcepub fn payload_value(&self) -> Result<Value, Error>
pub fn payload_value(&self) -> Result<Value, Error>
The payload as a JSON value, whatever the wire format.
Sourcepub fn as_message(&self) -> Message<'_>
pub fn as_message(&self) -> Message<'_>
The message as a Message again, borrowing from this one.
Trait Implementations§
Source§impl Clone for OwnedMessage
impl Clone for OwnedMessage
Auto Trait Implementations§
impl !Freeze for OwnedMessage
impl Forget for OwnedMessage
impl Move for OwnedMessage
impl RefUnwindSafe for OwnedMessage
impl Send for OwnedMessage
impl Sync for OwnedMessage
impl Unpin for OwnedMessage
impl UnsafeUnpin for OwnedMessage
impl UnwindSafe for OwnedMessage
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