Struct leptos_use::UseWebNotificationOptions
source · pub struct UseWebNotificationOptions { /* private fields */ }
Expand description
Options for use_web_notification_with_options
.
See MDN Docs for more info.
The following implementations are missing:
vibrate
Implementations§
source§impl UseWebNotificationOptions
impl UseWebNotificationOptions
sourcepub fn title(self, value: impl Into<String>) -> Self
pub fn title(self, value: impl Into<String>) -> Self
The title property of the Notification interface indicates the title of the notification
sourcepub fn body<OptionInnerType>(
self,
value: impl Into<Option<OptionInnerType>>,
) -> Self
pub fn body<OptionInnerType>( self, value: impl Into<Option<OptionInnerType>>, ) -> Self
The body string of the notification as specified in the constructor’s options parameter.
sourcepub fn direction(self, value: NotificationDirection) -> Self
pub fn direction(self, value: NotificationDirection) -> Self
The text direction of the notification as specified in the constructor’s
options parameter. Can be LeftToRight
, RightToLeft
or Auto
(default).
See web_sys::NotificationDirection
for more info.
sourcepub fn language<OptionInnerType>(
self,
value: impl Into<Option<OptionInnerType>>,
) -> Self
pub fn language<OptionInnerType>( self, value: impl Into<Option<OptionInnerType>>, ) -> Self
The language code of the notification as specified in the constructor’s options parameter.
sourcepub fn tag<OptionInnerType>(
self,
value: impl Into<Option<OptionInnerType>>,
) -> Self
pub fn tag<OptionInnerType>( self, value: impl Into<Option<OptionInnerType>>, ) -> Self
The ID of the notification(if any) as specified in the constructor’s options parameter.
sourcepub fn icon<OptionInnerType>(
self,
value: impl Into<Option<OptionInnerType>>,
) -> Self
pub fn icon<OptionInnerType>( self, value: impl Into<Option<OptionInnerType>>, ) -> Self
The URL of the image used as an icon of the notification as specified in the constructor’s options parameter.
sourcepub fn image<OptionInnerType>(
self,
value: impl Into<Option<OptionInnerType>>,
) -> Self
pub fn image<OptionInnerType>( self, value: impl Into<Option<OptionInnerType>>, ) -> Self
The URL of the image to be displayed as part of the notification as specified in the constructor’s options parameter.
sourcepub fn require_interaction(self, value: bool) -> Self
pub fn require_interaction(self, value: bool) -> Self
A boolean value indicating that a notification should remain active until the user clicks or dismisses it, rather than closing automatically.
sourcepub fn renotify(self, value: impl Into<bool>) -> Self
pub fn renotify(self, value: impl Into<bool>) -> Self
A boolean value specifying whether the user should be notified after a new notification replaces an old one.
The default is false
, which means they won’t be notified. If true
, then tag
also must be set.
sourcepub fn silent<OptionInnerType>(
self,
value: impl Into<Option<OptionInnerType>>,
) -> Self
pub fn silent<OptionInnerType>( self, value: impl Into<Option<OptionInnerType>>, ) -> Self
A boolean value specifying whether the notification should be silent, regardless of the device settings.
The default is false
, which means the notification is not silent. If true
, then the notification will be silent.
sourcepub fn on_click(self, value: impl Fn(Event) + 'static) -> Self
pub fn on_click(self, value: impl Fn(Event) + 'static) -> Self
Called when the user clicks on displayed Notification
.
sourcepub fn on_close(self, value: impl Fn(Event) + 'static) -> Self
pub fn on_close(self, value: impl Fn(Event) + 'static) -> Self
Called when the user closes a Notification
.
Trait Implementations§
source§impl Clone for UseWebNotificationOptions
impl Clone for UseWebNotificationOptions
source§fn clone(&self) -> UseWebNotificationOptions
fn clone(&self) -> UseWebNotificationOptions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Default for UseWebNotificationOptions
impl Default for UseWebNotificationOptions
source§impl From<&UseWebNotificationOptions> for NotificationOptions
impl From<&UseWebNotificationOptions> for NotificationOptions
source§fn from(options: &UseWebNotificationOptions) -> Self
fn from(options: &UseWebNotificationOptions) -> Self
Auto Trait Implementations§
impl Freeze for UseWebNotificationOptions
impl !RefUnwindSafe for UseWebNotificationOptions
impl !Send for UseWebNotificationOptions
impl !Sync for UseWebNotificationOptions
impl Unpin for UseWebNotificationOptions
impl !UnwindSafe for UseWebNotificationOptions
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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