pub struct Message {
pub topic: OwnedBytes,
pub payload: OwnedBytes,
}
Expand description
A PubSub
message.
Fields§
§topic: OwnedBytes
The topic of the message.
payload: OwnedBytes
The payload of the message.
Implementations§
source§impl Message
impl Message
sourcepub fn new<Topic: Serialize, Payload: Serialize>(
topic: &Topic,
payload: &Payload
) -> Result<Self, Error>
pub fn new<Topic: Serialize, Payload: Serialize>( topic: &Topic, payload: &Payload ) -> Result<Self, Error>
sourcepub fn raw<S: Into<OwnedBytes>, B: Into<OwnedBytes>>(
topic: S,
payload: B
) -> Self
pub fn raw<S: Into<OwnedBytes>, B: Into<OwnedBytes>>( topic: S, payload: B ) -> Self
Creates a new message with a raw payload.
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 RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin 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