pub struct NotificationsPanel { /* private fields */ }Expand description
The log pushed by the host’s Notifications service.
Call poll each frame, even while the panel is hidden, and show
unread as the bar entry’s badge with
WidgetBar::set_notification_cnt.
show marks every entry read.
Implementations§
Source§impl NotificationsPanel
impl NotificationsPanel
Sourcepub fn new() -> Self
pub fn new() -> Self
An unconnected panel. Attach a service with set_service.
Sourcepub fn set_service(&mut self, service: Arc<dyn Notifications>)
pub fn set_service(&mut self, service: Arc<dyn Notifications>)
Attach a host service, clearing the previous one’s entries.
Sourcepub fn push(&mut self, entry: Notification)
pub fn push(&mut self, entry: Notification)
Append a local entry, such as a terminal alert, to the same bounded log.
Sourcepub fn poll(&mut self, ctx: &Context) -> Vec<Notification>
pub fn poll(&mut self, ctx: &Context) -> Vec<Notification>
Receive the service’s pushes and return them, for popup notifications, and watch again
after a lagged stream. Entries added with push are not returned.
Sourcepub fn show(&mut self, ui: &mut Ui) -> NotificationsAction
pub fn show(&mut self, ui: &mut Ui) -> NotificationsAction
Render the log, newest first, after poll.
Trait Implementations§
Source§impl Default for NotificationsPanel
impl Default for NotificationsPanel
Source§fn default() -> NotificationsPanel
fn default() -> NotificationsPanel
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for NotificationsPanel
impl !UnwindSafe for NotificationsPanel
impl Freeze for NotificationsPanel
impl Send for NotificationsPanel
impl Sync for NotificationsPanel
impl Unpin for NotificationsPanel
impl UnsafeUnpin for NotificationsPanel
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
Converts
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> ⓘ
Converts
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