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:
renotify
vibrate
silent
image
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 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 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> 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