Struct yew_notifications::Notification
source · pub struct Notification { /* private fields */ }
Expand description
Standard notification.
Implementations§
source§impl Notification
impl Notification
pub const NOTIFICATION_LIFETIME: Duration = _
sourcepub fn new(
notification_type: NotificationType,
title: impl Into<String>,
text: impl Into<String>,
lifetime: Duration
) -> Self
pub fn new( notification_type: NotificationType, title: impl Into<String>, text: impl Into<String>, lifetime: Duration ) -> Self
Creates a new standard notification from notification type, title, text, and lifetime duration.
sourcepub fn from_description_and_type(
notification_type: NotificationType,
text: impl Into<String>
) -> Self
pub fn from_description_and_type( notification_type: NotificationType, text: impl Into<String> ) -> Self
Creates a new standard notification from notification type and text.
Title will be omitted. Notification lifetime is equal to the Self::NOTIFICATION_LIFETIME
.
sourcepub fn with_title(self, new_title: impl Into<String>) -> Self
pub fn with_title(self, new_title: impl Into<String>) -> Self
Set the title for the notification.
sourcepub fn with_type(self, new_notification_type: NotificationType) -> Self
pub fn with_type(self, new_notification_type: NotificationType) -> Self
Set the type for the notification.
sourcepub fn reset_lifetime(self) -> Self
pub fn reset_lifetime(self) -> Self
Resets notification lifetime.
It means that after this method invocation, the lifetime of the notification will be equal to the start value.
Trait Implementations§
source§impl Clone for Notification
impl Clone for Notification
source§fn clone(&self) -> Notification
fn clone(&self) -> Notification
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Notification
impl Debug for Notification
source§impl Notifiable for Notification
impl Notifiable for Notification
source§fn id(&self) -> Uuid
fn id(&self) -> Uuid
Returns the id of the notification. Every notification has the id of the Uuid type and it should be unique.
source§fn apply_tick(&mut self, time: Duration)
fn apply_tick(&mut self, time: Duration)
Applies some amount of time to this notification. Read more
source§impl NotifiableComponentFactory<Notification> for NotificationFactory
impl NotifiableComponentFactory<Notification> for NotificationFactory
source§fn component(
&self,
notification: Notification,
onclick: Callback<MouseEvent>,
onenter: Callback<MouseEvent>,
onleave: Callback<MouseEvent>
) -> Html
fn component( &self, notification: Notification, onclick: Callback<MouseEvent>, onenter: Callback<MouseEvent>, onleave: Callback<MouseEvent> ) -> Html
Creates a new notification component that can be rendered in
yew
.source§impl PartialEq for Notification
impl PartialEq for Notification
source§fn eq(&self, other: &Notification) -> bool
fn eq(&self, other: &Notification) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for Notification
Auto Trait Implementations§
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
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
§fn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
Convert
self
to a value of a Properties
struct.§impl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
§fn into_prop_value(self) -> T
fn into_prop_value(self) -> T
Convert
self
to a value of a Properties
struct.