pub enum Number<'a> {
Int(i128),
IEEE754(f64),
Decimal {
exponent: i128,
mantissa: Cow<'a, [u8]>,
inverted: bool,
},
Float {
exponent: i128,
mantissa: Cow<'a, [u8]>,
inverted: bool,
},
}Expand description
Representation of a number extracted from a CBOR item
Variants§
Int(i128)
an integer number from major types 0 or 1
IEEE754(f64)
a floating-point number from major type 7
Decimal
a big integer or big decimal with value mantissa * 10.pow(exponent)
Fields
Float
a big integer or big decimal with value mantissa * 2.pow(exponent)
Trait Implementations§
source§impl<'a> PartialEq for Number<'a>
impl<'a> PartialEq for Number<'a>
impl<'a> StructuralPartialEq for Number<'a>
Auto Trait Implementations§
impl<'a> Freeze for Number<'a>
impl<'a> RefUnwindSafe for Number<'a>
impl<'a> Send for Number<'a>
impl<'a> Sync for Number<'a>
impl<'a> Unpin for Number<'a>
impl<'a> UnwindSafe for Number<'a>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)