pub enum AppBadge {
None,
Count(u32),
Text(String),
Dot,
}Expand description
What to show on the app’s icon in the Dock, launcher, home screen, or taskbar (docs/badge.md).
Distinct from NavItem::badge, which annotates a sidebar row inside the window. This one
decorates the application itself and is drawn by the shell, not by Day.
What each payload needs is asked separately (Cap::AppBadgeCount, AppBadgeText,
AppBadgeDot) because the platforms differ in what they accept more than in whether they have
a badge at all: macOS takes arbitrary text, iOS and the web take a number, Android takes nothing.
Variants§
None
Clear the badge.
Count(u32)
A count. Zero clears it, matching every platform’s own convention.
Text(String)
Short arbitrary text ("99+", "beta"). Only macOS renders it; probe Cap::AppBadgeText.
Dot
An indicator with no value.
Trait Implementations§
impl Eq for AppBadge
impl StructuralPartialEq for AppBadge
Auto Trait Implementations§
impl Forget for AppBadge
impl Freeze for AppBadge
impl Move for AppBadge
impl RefUnwindSafe for AppBadge
impl Send for AppBadge
impl Sync for AppBadge
impl Unpin for AppBadge
impl UnsafeUnpin for AppBadge
impl UnwindSafe for AppBadge
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
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