pub struct Notification {
pub channel: String,
pub payload: String,
}Expand description
A received pub/sub notification.
Fields§
§channel: StringChannel the notification was received on.
payload: StringRaw payload string.
Implementations§
Source§impl Notification
impl Notification
Sourcepub fn decode<T: DeserializeOwned>(&self) -> Result<T>
pub fn decode<T: DeserializeOwned>(&self) -> Result<T>
Deserialize the payload as JSON.
Trait Implementations§
Source§impl Clone for Notification
impl Clone for Notification
Source§fn clone(&self) -> Notification
fn clone(&self) -> Notification
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for Notification
impl RefUnwindSafe for Notification
impl Send for Notification
impl Sync for Notification
impl Unpin for Notification
impl UnsafeUnpin for Notification
impl UnwindSafe for Notification
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