pub struct PaneAnnouncer { /* private fields */ }Expand description
Coalescing announcer that keeps host live regions / status lines bounded and
non-spammy: the latest offered announcement wins (so a burst of resize/repeat
announcements collapses to one), and consecutive identical text is
suppressed. Hosts call PaneAnnouncer::take once per render / live-region
update.
Implementations§
Source§impl PaneAnnouncer
impl PaneAnnouncer
Sourcepub fn offer(&mut self, announcement: Option<PaneAnnouncement>)
pub fn offer(&mut self, announcement: Option<PaneAnnouncement>)
Offer an announcement; the most recent non-empty offer is retained, so rapid bursts coalesce to the final state.
Sourcepub fn take(&mut self) -> Option<PaneAnnouncement>
pub fn take(&mut self) -> Option<PaneAnnouncement>
Take the pending announcement to speak now, suppressing an exact repeat of the previously spoken text.
Sourcepub fn pending(&self) -> Option<&PaneAnnouncement>
pub fn pending(&self) -> Option<&PaneAnnouncement>
Peek the pending announcement without consuming it.
Sourcepub fn last_spoken(&self) -> Option<&str>
pub fn last_spoken(&self) -> Option<&str>
The most recently spoken announcement text.
Trait Implementations§
Source§impl Clone for PaneAnnouncer
impl Clone for PaneAnnouncer
Source§fn clone(&self) -> PaneAnnouncer
fn clone(&self) -> PaneAnnouncer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 PaneAnnouncer
impl Debug for PaneAnnouncer
Source§impl Default for PaneAnnouncer
impl Default for PaneAnnouncer
Source§fn default() -> PaneAnnouncer
fn default() -> PaneAnnouncer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PaneAnnouncer
impl RefUnwindSafe for PaneAnnouncer
impl Send for PaneAnnouncer
impl Sync for PaneAnnouncer
impl Unpin for PaneAnnouncer
impl UnsafeUnpin for PaneAnnouncer
impl UnwindSafe for PaneAnnouncer
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