Add toast example

This commit is contained in:
Cory Forsstrom 2023-01-17 17:10:58 -08:00
parent 3ab6797255
commit d470467718
No known key found for this signature in database
GPG key ID: 1DFE170A4415C9F5
3 changed files with 689 additions and 0 deletions

View file

@ -25,6 +25,11 @@ impl<'a, Message> Shell<'a, Message> {
}
}
/// Returns true if the [`Shell`] contains no published messages
pub fn is_empty(&self) -> bool {
self.messages.is_empty()
}
/// Publish the given `Message` for an application to process it.
pub fn publish(&mut self, message: Message) {
self.messages.push(message);