pub struct Message {
pub subject: String,
pub reply: Option<String>,
pub data: Vec<u8>,
pub headers: Option<HeaderMap>,
/* private fields */
}
Expand description
A message received on a subject.
Fields
subject: String
The subject this message came from.
reply: Option<String>
Optional reply subject that may be used for sending a response to this message.
data: Vec<u8>
The message contents.
headers: Option<HeaderMap>
Optional headers associated with this Message
.
Implementations
sourceimpl Message
impl Message
sourcepub fn new(
subject: &str,
reply: Option<&str>,
data: impl AsRef<[u8]>,
headers: Option<HeaderMap>
) -> Message
pub fn new(
subject: &str,
reply: Option<&str>,
data: impl AsRef<[u8]>,
headers: Option<HeaderMap>
) -> Message
Creates new empty Message
, without a Client.
Useful for passing Message
data or creating Message
instance without caring about Client
,
but cannot be used on it’s own for associated methods as those require Client
injected into Message
and will error without it.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl !UnwindSafe for Message
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more