pub struct Message<T: Serialize + Debug> { /* private fields */ }Implementations§
Source§impl<T: Serialize + Debug> Message<T>
impl<T: Serialize + Debug> Message<T>
Sourcepub fn new(
topic: String,
headers: HashMap<String, String>,
data: T,
key: String,
) -> Self
pub fn new( topic: String, headers: HashMap<String, String>, data: T, key: String, ) -> Self
Creates a new Message struct
§Arguments
topic- A topic that the message should be published toheaders- A HashMap that holds the headers that should be published with the messagedata- A generic type that holds the data that should be published, data should be serializablekey- A key that should be used to publish the message
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Message<T>where
T: Freeze,
impl<T> RefUnwindSafe for Message<T>where
T: RefUnwindSafe,
impl<T> Send for Message<T>where
T: Send,
impl<T> Sync for Message<T>where
T: Sync,
impl<T> Unpin for Message<T>where
T: Unpin,
impl<T> UnwindSafe for Message<T>where
T: UnwindSafe,
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