pub struct VNumber(/* private fields */);Expand description
A JSON number value.
VNumber can represent integers (signed and unsigned) and floating point numbers.
It stores the number in the most appropriate internal format.
Implementations§
Source§impl VNumber
impl VNumber
Sourcepub fn to_f64_lossy(&self) -> f64
pub fn to_f64_lossy(&self) -> f64
Converts to f64, potentially losing precision.
Sourcepub fn is_float(&self) -> bool
pub fn is_float(&self) -> bool
Returns true if this number was created from a floating point value.
Sourcepub fn is_integer(&self) -> bool
pub fn is_integer(&self) -> bool
Returns true if this number is an integer (signed or unsigned).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VNumber
impl RefUnwindSafe for VNumber
impl Send for VNumber
impl Sync for VNumber
impl Unpin for VNumber
impl UnsafeUnpin for VNumber
impl UnwindSafe for VNumber
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