pub struct Recipient { /* private fields */ }Expand description
Where one recipient can be reached, per channel.
A route per channel rather than a User trait: the address a notification
goes to is not always a column on a model — a webhook URL belongs to a
team, an email address may come from a form.
Implementations§
Source§impl Recipient
impl Recipient
pub fn new() -> Recipient
pub fn named(name: impl Into<String>) -> Recipient
Sourcepub fn webhook(self, url: impl Into<String>) -> Recipient
pub fn webhook(self, url: impl Into<String>) -> Recipient
Where to POST this recipient’s webhooks.
Sourcepub fn database(self, key: impl Into<String>) -> Recipient
pub fn database(self, key: impl Into<String>) -> Recipient
What identifies this recipient in the application’s own store.
pub fn route(self, channel: &str, value: impl Into<String>) -> Recipient
pub fn route_for(&self, channel: &str) -> Option<&str>
pub fn name(&self) -> Option<&str>
Trait Implementations§
impl Eq for Recipient
impl StructuralPartialEq for Recipient
Auto Trait Implementations§
impl Freeze for Recipient
impl RefUnwindSafe for Recipient
impl Send for Recipient
impl Sync for Recipient
impl Unpin for Recipient
impl UnsafeUnpin for Recipient
impl UnwindSafe for Recipient
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