pub struct Toast;Expand description
Helper for displaying toast notifications within the UI.
This utility provides a consistent interface for raising user-facing toast messages through the application’s toast API. It centralizes formatting, duration choices, and toast types so that components can emit notifications without duplicating boilerplate.
All methods delegate to a private wrapper around
[consume_toast()], which retrieves the active toast handle and
displays the configured toast.
Implementations§
Source§impl Toast
impl Toast
Sourcepub fn command_error(command: &str, error: String)
pub fn command_error(command: &str, error: String)
Displays an error toast corresponding to a failed user command.
This is intended for surfacing errors triggered by client-side
actions (button clicks, form submissions, etc.) and logs the error
via warn! before showing a toast.
The toast is non-permanent and remains visible for 30 seconds.
Sourcepub fn available_game(event: AvailableGameEventDTO)
pub fn available_game(event: AvailableGameEventDTO)
Displays a notification in response to a change in game availability.
This is typically called when the application receives an
AvailableGameEventDTO from the server. The toast indicates
whether a game was created or removed.
The toast is informational and expires after 10 seconds.
Sourcepub fn score(title: &str, description: &str)
pub fn score(title: &str, description: &str)
Displays a notification of scoring.
The toast is informational and expires after 10 seconds.
Sourcepub fn server_error(service: &str, error: String)
pub fn server_error(service: &str, error: String)
Displays a server-side error notification.
Intended for situations where a backend service returns an error or cannot be reached. These are treated as higher-severity issues and are shown as warning toasts with a longer, permanent duration.
Auto Trait Implementations§
impl Freeze for Toast
impl RefUnwindSafe for Toast
impl Send for Toast
impl Sync for Toast
impl Unpin 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
§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
§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>
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