#[non_exhaustive]pub enum FormattedNumberValue {
Number(f64),
Text(String),
}Expand description
The value FormattedNumber formats: a number, or text read the way Lumen’s parseLumenNumber
reads it.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Number(f64)
A double, like a JavaScript number. NaN and infinities render the fallback text.
Text(String)
Plain decimal text such as "-1234.5" or " 2e3 ". Surrounding whitespace is ignored;
hexadecimal, "Infinity", empty text, and text longer than 64 characters render the
fallback text.
Trait Implementations§
Source§impl Clone for FormattedNumberValue
impl Clone for FormattedNumberValue
Source§impl Debug for FormattedNumberValue
impl Debug for FormattedNumberValue
Source§impl From<&str> for FormattedNumberValue
Parses the text when formatting, like parseLumenNumber.
impl From<&str> for FormattedNumberValue
Parses the text when formatting, like parseLumenNumber.
Source§impl From<String> for FormattedNumberValue
Parses the text when formatting, like parseLumenNumber.
impl From<String> for FormattedNumberValue
Parses the text when formatting, like parseLumenNumber.
Source§impl From<f32> for FormattedNumberValue
Widens a single-precision float without loss.
impl From<f32> for FormattedNumberValue
Widens a single-precision float without loss.
Source§impl From<f64> for FormattedNumberValue
Formats a double as is.
impl From<f64> for FormattedNumberValue
Formats a double as is.
Source§impl From<i32> for FormattedNumberValue
Converts the integer without loss.
impl From<i32> for FormattedNumberValue
Converts the integer without loss.
Source§impl From<i64> for FormattedNumberValue
Rounds integers beyond 2^53 to the nearest double, as JavaScript’s Number(bigint) does.
impl From<i64> for FormattedNumberValue
Rounds integers beyond 2^53 to the nearest double, as JavaScript’s Number(bigint) does.
Source§impl From<u32> for FormattedNumberValue
Converts the integer without loss.
impl From<u32> for FormattedNumberValue
Converts the integer without loss.
Source§impl From<u64> for FormattedNumberValue
Rounds integers beyond 2^53 to the nearest double, as JavaScript’s Number(bigint) does.
impl From<u64> for FormattedNumberValue
Rounds integers beyond 2^53 to the nearest double, as JavaScript’s Number(bigint) does.
Source§impl From<usize> for FormattedNumberValue
Rounds integers beyond 2^53 to the nearest double, as JavaScript’s Number(bigint) does.
impl From<usize> for FormattedNumberValue
Rounds integers beyond 2^53 to the nearest double, as JavaScript’s Number(bigint) does.
Source§impl PartialEq for FormattedNumberValue
impl PartialEq for FormattedNumberValue
impl StructuralPartialEq for FormattedNumberValue
Auto Trait Implementations§
impl Forget for FormattedNumberValue
impl Freeze for FormattedNumberValue
impl Move for FormattedNumberValue
impl RefUnwindSafe for FormattedNumberValue
impl Send for FormattedNumberValuewhere
RawVecInner: Send,
impl Sync for FormattedNumberValuewhere
RawVecInner: Sync,
impl Unpin for FormattedNumberValue
impl UnsafeUnpin for FormattedNumberValue
impl UnwindSafe for FormattedNumberValuewhere
RawVecInner: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DependencyElement for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
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