pub struct ToastAction {
pub label: String,
pub id: String,
}Expand description
An interactive action button displayed in a toast.
Actions allow users to respond to a toast (e.g., “Undo”, “Retry”, “View”). Each action has a display label and a unique identifier used to match callbacks when the action is invoked.
§Invariants
labelmust be non-empty after trimming whitespace.idmust be non-empty; it serves as the stable callback key.- Display width of
labelis bounded by toastmax_widthminus chrome.
§Evidence Ledger
Action focus uses a simple round-robin model: Tab advances focus index
modulo action count. This is deterministic and requires no scoring heuristic.
The decision rule is: next_focus = (current_focus + 1) % actions.len().
Fields§
§label: StringDisplay label for the action button (e.g., “Undo”).
id: StringUnique identifier for callback matching.
Implementations§
Trait Implementations§
Source§impl Clone for ToastAction
impl Clone for ToastAction
Source§fn clone(&self) -> ToastAction
fn clone(&self) -> ToastAction
Returns a duplicate 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 ToastAction
impl Debug for ToastAction
Source§impl PartialEq for ToastAction
impl PartialEq for ToastAction
impl Eq for ToastAction
impl StructuralPartialEq for ToastAction
Auto Trait Implementations§
impl Freeze for ToastAction
impl RefUnwindSafe for ToastAction
impl Send for ToastAction
impl Sync for ToastAction
impl Unpin for ToastAction
impl UnsafeUnpin for ToastAction
impl UnwindSafe for ToastAction
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.