pub struct Quantity { /* private fields */ }Expand description
A number, the caller’s wording for it, and how it was arrived at.
Implementations§
Source§impl Quantity
impl Quantity
Sourcepub fn measured(amount: f64, text: impl Into<SharedString>) -> Self
pub fn measured(amount: f64, text: impl Into<SharedString>) -> Self
A counted number. text is the caller’s own formatting of it.
Sourcepub fn estimated(amount: f64, text: impl Into<SharedString>) -> Self
pub fn estimated(amount: f64, text: impl Into<SharedString>) -> Self
An estimate. Every rendering of it says so.
pub fn basis(&self) -> Basis
Sourcepub fn text(&self) -> &SharedString
pub fn text(&self) -> &SharedString
The caller’s wording, without the estimate label.
Sourcepub fn display(&self, cx: &App) -> SharedString
pub fn display(&self, cx: &App) -> SharedString
What a reader reads and what the node publishes: the caller’s wording, carrying its basis when the basis is one a reader must know about.
Trait Implementations§
impl StructuralPartialEq for Quantity
Auto Trait Implementations§
impl Freeze for Quantity
impl RefUnwindSafe for Quantity
impl Send for Quantity
impl Sync for Quantity
impl Unpin for Quantity
impl UnsafeUnpin for Quantity
impl UnwindSafe for Quantity
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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