pub struct Notification { /* private fields */ }
Expand description

Standard notification.

Implementations§

source§

impl Notification

source

pub const NOTIFICATION_LIFETIME: Duration = _

source

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.

source

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.

source

pub fn with_title(self, new_title: impl Into<String>) -> Self

Set the title for the notification.

source

pub fn with_type(self, new_notification_type: NotificationType) -> Self

Set the type for the notification.

source

pub fn with_text(self, new_text: impl Into<String>) -> Self

Set the text for the notification.

source

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

source§

fn clone(&self) -> Notification

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Notification

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Notifiable for Notification

source§

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)

Applies some amount of time to this notification. Read more
source§

fn is_alive(&self) -> bool

Check if the notification is still “alive”. If it returns false, then this notification will be deleted (disappeared) on the next time tick.
source§

fn mouse_in(&mut self)

This function calls when the mouse enters this notification.
source§

fn mouse_out(&mut self)

This function calls when the mouse leaves this notification.
source§

fn is_paused(&self) -> bool

Check if the notification is still “paused”. It means, that when notification is paused (this function returns true) then time does not affect the notification lifetime.
source§

impl NotifiableComponentFactory<Notification> for NotificationFactory

source§

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

source§

fn eq(&self, other: &Notification) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for Notification

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoPropValue<Option<T>> for T

§

fn into_prop_value(self) -> Option<T>

Convert self to a value of a Properties struct.
§

impl<T> IntoPropValue<T> for T

§

fn into_prop_value(self) -> T

Convert self to a value of a Properties struct.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> HasAllProps<(), T> for T