pub struct Decimal { /* private fields */ }Expand description
An exact decimal: m / 10^e.
Implementations§
Source§impl Decimal
impl Decimal
Sourcepub fn parse(s: &str) -> Option<Self>
pub fn parse(s: &str) -> Option<Self>
A declaration’s decimal string, -?(0|[1-9][0-9]*)(\.[0-9]+)?.
Sourcepub fn parse_input(s: &str) -> Option<Self>
pub fn parse_input(s: &str) -> Option<Self>
A writer’s decimal: a JSON number’s text (RFC 8259 §6, core §7.6
“What a writer takes”), the declaration grammar with an exponent
allowed: no +, no leading zero, no bare point.
Trait Implementations§
impl Eq for Decimal
Source§impl FromStr for Decimal
impl FromStr for Decimal
Source§fn from_str(s: &str) -> Result<Self, WriteRefusal>
fn from_str(s: &str) -> Result<Self, WriteRefusal>
A writer’s decimal (Decimal::parse_input): value when it does
not read.
Source§type Err = WriteRefusal
type Err = WriteRefusal
The associated error which can be returned from parsing.
Source§impl Ord for Decimal
impl Ord for Decimal
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Decimal
impl PartialOrd for Decimal
impl StructuralPartialEq for Decimal
Auto Trait Implementations§
impl Forget for Decimal
impl Freeze for Decimal
impl Move for Decimal
impl RefUnwindSafe for Decimal
impl Send for Decimalwhere
RawVecInner: Send,
impl Sync for Decimalwhere
RawVecInner: Sync,
impl Unpin for Decimal
impl UnsafeUnpin for Decimal
impl UnwindSafe for Decimalwhere
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
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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