pub struct Notifications<U> { /* private fields */ }Expand description
A Widget to show notifications
With the FooterWidgets (a WidgetAlias), this Widget
can be conveniently placed alongside a PromptLine and a
StatusLine, in a combination that hides the PromptLine
when it is not in use, covering it with the Notifications, and
vice-versa. This is the default behaviour of Duat.
setup_duat!(setup);
use duat::prelude::*;
fn setup() {
hook::remove("WindowWidgets");
hook::add::<WindowCreated>(|_, builder| {
let footer = FooterWidgets::default().notifs(Notifications::cfg().formatted(|rec| {
txt!(
"[notifs.bracket]([notifs.target]{}[notifs.bracket]) {}",
rec.target(),
rec.text().clone()
)
}));
builder.push(footer);
});
}Trait Implementations§
Source§impl<U: Ui> Widget<U> for Notifications<U>
impl<U: Ui> Widget<U> for Notifications<U>
Source§fn once() -> Result<(), Text>
fn once() -> Result<(), Text>
Actions taken when this widget opens for the first time Read more
Source§fn needs_update(&self, _: &Pass) -> bool
fn needs_update(&self, _: &Pass) -> bool
Auto Trait Implementations§
impl<U> !Freeze for Notifications<U>
impl<U> !RefUnwindSafe for Notifications<U>
impl<U> Send for Notifications<U>where
U: Send,
impl<U> !Sync for Notifications<U>
impl<U> Unpin for Notifications<U>where
U: Unpin,
impl<U> !UnwindSafe for Notifications<U>
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