pub struct StatusItem { /* private fields */ }Expand description
One thing the bar says.
Implementations§
Source§impl StatusItem
impl StatusItem
pub fn text(id: impl Into<SharedString>, label: impl Into<SharedString>) -> Self
Sourcepub fn state(
id: impl Into<SharedString>,
label: impl Into<SharedString>,
tone: Tone,
) -> Self
pub fn state( id: impl Into<SharedString>, label: impl Into<SharedString>, tone: Tone, ) -> Self
A dot and words. The tone is the host’s judgement, never the bar’s.
Sourcepub fn progress(
id: impl Into<SharedString>,
label: impl Into<SharedString>,
) -> Self
pub fn progress( id: impl Into<SharedString>, label: impl Into<SharedString>, ) -> Self
A ring. Without a fraction or a count the extent is unknown, and is drawn as unknown rather than as a ring that happens to be part full.
Sourcepub fn action(
id: impl Into<SharedString>,
label: impl Into<SharedString>,
) -> Self
pub fn action( id: impl Into<SharedString>, label: impl Into<SharedString>, ) -> Self
A control. Without on_click it installs no handler and is refused.
Sourcepub fn element(
id: impl Into<SharedString>,
label: impl Into<SharedString>,
element: impl IntoElement,
) -> Self
pub fn element( id: impl Into<SharedString>, label: impl Into<SharedString>, element: impl IntoElement, ) -> Self
Whatever the caller wants in the strip, usually a Popover or a Menu
that opens from it. The element publishes its own identities.
pub fn fraction(self, fraction: f32) -> Self
pub fn count(self, done: usize, total: usize) -> Self
pub fn icon(self, glyph: Icon) -> Self
Sourcepub fn state_name(self, state: impl Into<SharedString>) -> Self
pub fn state_name(self, state: impl Into<SharedString>) -> Self
The name of the state the host says this item is in. Publishing it is how a test reads what the host claimed rather than what was painted.
Sourcepub fn stale(self, stale: bool) -> Self
pub fn stale(self, stale: bool) -> Self
Marks the text as the last verified value rather than the current one.
Sourcepub fn tracking<E>(self, value: &AsyncValue<SharedString, E>) -> Self
pub fn tracking<E>(self, value: &AsyncValue<SharedString, E>) -> Self
Takes the text and the staleness from a value the host is refreshing.
A refresh that failed keeps the last verified text on screen and marks it stale; a value the host never had shows the item’s own label.
pub fn on_click(self, handler: impl Fn(&mut Window, &mut App) + 'static) -> Self
pub fn id(&self) -> &SharedString
pub fn label(&self) -> &SharedString
pub fn is_stale(&self) -> bool
Trait Implementations§
Source§impl Debug for StatusItem
impl Debug for StatusItem
Source§impl Disableable for StatusItem
impl Disableable for StatusItem
Auto Trait Implementations§
impl !RefUnwindSafe for StatusItem
impl !Send for StatusItem
impl !Sync for StatusItem
impl !UnwindSafe for StatusItem
impl Freeze for StatusItem
impl Unpin for StatusItem
impl UnsafeUnpin for StatusItem
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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