Trait generic_json::Number[][src]

pub trait Number: Eq {
    fn as_u32(&self) -> Option<u32>;
fn as_u64(&self) -> Option<u64>;
fn as_i32(&self) -> Option<i32>;
fn as_i64(&self) -> Option<i64>;
fn as_f32(&self) -> Option<f32>;
fn as_f32_lossy(&self) -> f32;
fn as_f64(&self) -> Option<f64>;
fn as_f64_lossy(&self) -> f64; }
Expand description

JSON number.

Required methods

Returns this number as an u32 if it can be exactly represented as such.

Returns this number as an u64 if it can be exactly represented as such.

Returns this number as an i32 if it can be exactly represented as such.

Returns this number as an i64 if it can be exactly represented as such.

Returns this number as an f32 if it can be exactly represented as such.

Returns this number as an f32, potentially losing precision in the process.

Returns this number as an f64 if it can be exactly represented as such.

Returns this number as an f64, potentially losing precision in the process.

Implementors