pub struct Notification { /* private fields */ }Expand description
Fluent builder for a notification sent to a specific event name.
§Example
use notifica_crate::{EmailPayload, Notification};
let n = Notification::new()
.email(EmailPayload::new("user@example.com").subject("Welcome!"))
.push(vec!["device-token".into()])
.request([("key".into(), "value".into())]);Implementations§
Source§impl Notification
impl Notification
Sourcepub fn email(self, p: EmailPayload) -> Self
pub fn email(self, p: EmailPayload) -> Self
Attach an email payload.
Sourcepub fn push(self, tokens: impl Into<Vec<String>>) -> Self
pub fn push(self, tokens: impl Into<Vec<String>>) -> Self
Attach a push notification payload (device tokens).
Trait Implementations§
Source§impl Debug for Notification
impl Debug for Notification
Source§impl Default for Notification
impl Default for Notification
Source§fn default() -> Notification
fn default() -> Notification
Returns the “default value” for a type. Read more
Auto 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