pub struct Number { /* private fields */ }Expand description
A number as it was spelt, so 1920.0 and 1920 stay apart.
Implementations§
Source§impl Number
impl Number
Sourcepub fn parse(text: &str) -> Option<Self>
pub fn parse(text: &str) -> Option<Self>
A number from a JSON spelling, or None when text is not one.
Sourcepub fn float(value: f64) -> Self
pub fn float(value: f64) -> Self
A float in its shortest spelling that reads back to it; NaN and infinities are kept
as NumberKind::NotFinite.
Sourcepub const fn kind(&self) -> NumberKind
pub const fn kind(&self) -> NumberKind
What the spelling says.
Trait Implementations§
impl Eq for Number
impl StructuralPartialEq for Number
Auto Trait Implementations§
impl Forget for Number
impl Freeze for Number
impl Move for Number
impl RefUnwindSafe for Number
impl Send for Numberwhere
RawVecInner: Send,
impl Sync for Numberwhere
RawVecInner: Sync,
impl Unpin for Number
impl UnsafeUnpin for Number
impl UnwindSafe for Numberwhere
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