Toaster::shown: the titles and severities on show, for owners and tests
This commit is contained in:
2 files changed
+18
No files matched your search
@@ -125,6 +125,12 @@ impl Toaster {
|
||||
id
|
||||
}
|
||||
|
||||
/// The titles and severities on show, oldest first.
|
||||
pub fn shown(&self) -> Vec<(SharedString, Option<Severity>)> {
|
||||
let staying = self.live.iter().filter(|live| !live.leaving);
|
||||
staying.map(|live| (live.toast.title.clone(), live.toast.severity)).collect()
|
||||
}
|
||||
|
||||
/// Sends a toast away: it fades and folds, then leaves the stack.
|
||||
pub fn dismiss(&mut self, id: u64, cx: &mut Context<Self>) {
|
||||
let Some(live) = self
|
||||
|
||||
Reference in new issue
Block a user