pub struct Toast {
pub id: u64,
pub kind: ToastKind,
pub message: String,
pub title: Option<String>,
pub trading: Option<TradingToast>,
pub duration: f32,
pub created_at: f64,
pub dismissible: bool,
}Expand description
A toast notification
Fields§
§id: u64Unique identifier
kind: ToastKindToast kind/severity
message: StringMessage to display
title: Option<String>Optional title
trading: Option<TradingToast>Optional structured order details.
duration: f32Duration in seconds (0 = permanent until dismissed)
created_at: f64Timestamp when the toast was created (in seconds since app start)
dismissible: boolWhether the toast can be dismissed by clicking
Implementations§
Source§impl Toast
impl Toast
Sourcepub fn with_title(self, title: impl Into<String>) -> Self
pub fn with_title(self, title: impl Into<String>) -> Self
Set the title
Sourcepub fn dismissible(self, dismissible: bool) -> Self
pub fn dismissible(self, dismissible: bool) -> Self
Set whether the toast can be dismissed by clicking
Sourcepub fn is_expired(&self, current_time: f64) -> bool
pub fn is_expired(&self, current_time: f64) -> bool
Check if the toast has expired
Sourcepub fn remaining_fraction(&self, current_time: f64) -> f32
pub fn remaining_fraction(&self, current_time: f64) -> f32
Get the remaining time as a fraction (1.0 = full, 0.0 = expired)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Toast
impl RefUnwindSafe for Toast
impl Send for Toast
impl Sync for Toast
impl Unpin for Toast
impl UnsafeUnpin for Toast
impl UnwindSafe for Toast
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
Converts
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> ⓘ
Converts
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