pub struct Stat { /* private fields */ }Expand description
One card of the dashboard, as Filament’s Stat::make($label, $value): a title (the label),
the number shown and an optional description under it, such as “3 drafts”.
Implementations§
Source§impl Stat
impl Stat
Sourcepub fn make(label: impl Into<String>, value: impl ToString) -> Self
pub fn make(label: impl Into<String>, value: impl ToString) -> Self
A card titled label showing value, such as Stat::make("Posts", 12). The value is
shown as its text, so it may be formatted already, such as "1.2k".
Sourcepub fn description(self, description: impl Into<String>) -> Self
pub fn description(self, description: impl Into<String>) -> Self
The line under the value, as Filament’s description().
Sourcepub fn get_description(&self) -> Option<&str>
pub fn get_description(&self) -> Option<&str>
The description, if set.
Trait Implementations§
impl Eq for Stat
Source§impl From<StatWidget> for Stat
impl From<StatWidget> for Stat
Source§fn from(widget: StatWidget) -> Self
fn from(widget: StatWidget) -> Self
Converts to this type from the input type.
impl StructuralPartialEq for Stat
Auto Trait Implementations§
impl Forget for Stat
impl Freeze for Stat
impl Move for Stat
impl RefUnwindSafe for Stat
impl Send for Stat
impl Sync for Stat
impl Unpin for Stat
impl UnsafeUnpin for Stat
impl UnwindSafe for Stat
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> ⓘ
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