pub struct Notification {Show 13 fields
pub title: String,
pub body: String,
pub tag: String,
pub language: String,
pub require_interaction: bool,
pub silent: Option<bool>,
pub icon_url: Option<ServoUrl>,
pub icon_resource: Option<Arc<Image>>,
pub badge_url: Option<ServoUrl>,
pub badge_resource: Option<Arc<Image>>,
pub image_url: Option<ServoUrl>,
pub image_resource: Option<Arc<Image>>,
pub actions: Vec<NotificationAction>,
}
Expand description
Data that could be used to display a desktop notification to the end user when the Notification API is called.
Fields§
§title: String
Title of the notification.
body: String
Body string of the notification.
tag: String
An identifier tag for the notification. Notification with the same tag can be replaced by another to avoid users’ screen being filled up with similar notifications.
language: String
The tag for the language used in the notification’s title, body, and the title of each its actions. RFC 5646
require_interaction: bool
A boolean value indicates the notification should remain readily available until the end user activates or dismisses the notification.
silent: Option<bool>
When true
, indicates no sounds or vibrations should be made. When None
,
the device’s default settings should be respected.
icon_url: Option<ServoUrl>
The URL of an icon. The icon will be displayed as part of the notification.
icon_resource: Option<Arc<Image>>
Icon’s raw image data and metadata.
badge_url: Option<ServoUrl>
The URL of a badge. The badge is used when there is no enough space to display the notification, such as on a mobile device’s notification bar.
badge_resource: Option<Arc<Image>>
Badge’s raw image data and metadata.
image_url: Option<ServoUrl>
The URL of an image. The image will be displayed as part of the notification.
image_resource: Option<Arc<Image>>
Image’s raw image data and metadata.
actions: Vec<NotificationAction>
Actions available for users to choose from for interacting with the notification.
Trait Implementations§
Source§impl Clone for Notification
impl Clone for Notification
Source§fn clone(&self) -> Notification
fn clone(&self) -> Notification
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for Notification
impl Debug for Notification
Source§impl<'de> Deserialize<'de> for Notification
impl<'de> Deserialize<'de> for Notification
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Notification
impl RefUnwindSafe for Notification
impl Send for Notification
impl Sync for Notification
impl Unpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more