pub struct NotifyRequest {
pub id: String,
pub title: String,
pub body: String,
pub ongoing: bool,
pub deeplink: Option<String>,
}Expand description
A local notification to post.
Fields§
§id: StringStable identifier: re-posting with the same id replaces the previous notification (used for progress updates).
title: StringThe first line of the notification.
body: StringThe text below the title.
ongoing: boolWhether this is an ongoing/progress notification (best-effort; platforms without ongoing notifications post a normal one).
deeplink: Option<String>Optional deep-link payload delivered to the app when the user taps it.
Implementations§
Source§impl NotifyRequest
impl NotifyRequest
Sourcepub fn new(
id: impl Into<String>,
title: impl Into<String>,
body: impl Into<String>,
) -> Self
pub fn new( id: impl Into<String>, title: impl Into<String>, body: impl Into<String>, ) -> Self
Creates a request that posts a normal notification with the given id, title and body.
Sourcepub fn ongoing(self, ongoing: bool) -> Self
pub fn ongoing(self, ongoing: bool) -> Self
Sets whether the notification is an ongoing or progress notification.
Sourcepub fn with_deeplink(self, deeplink: impl Into<String>) -> Self
pub fn with_deeplink(self, deeplink: impl Into<String>) -> Self
Sets the payload that the app receives when the person taps the notification.
Trait Implementations§
Source§impl Clone for NotifyRequest
impl Clone for NotifyRequest
Source§impl Debug for NotifyRequest
impl Debug for NotifyRequest
impl Eq for NotifyRequest
Source§impl PartialEq for NotifyRequest
impl PartialEq for NotifyRequest
impl StructuralPartialEq for NotifyRequest
Auto Trait Implementations§
impl Freeze for NotifyRequest
impl RefUnwindSafe for NotifyRequest
impl Send for NotifyRequest
impl Sync for NotifyRequest
impl Unpin for NotifyRequest
impl UnsafeUnpin for NotifyRequest
impl UnwindSafe for NotifyRequest
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