pub enum Numeric {
Integer(i64),
Float(f64),
UInteger(u64),
Byte(u8),
Int32(i32),
UInt32(u32),
Int16(i16),
UInt16(u16),
Int8(i8),
UInt8(u8),
}Expand description
Core data structure representing a numeric value node in the parsed tree Represents different numeric types that can be stored in a JSON node Represents different numeric types that can be stored in AST nodes across format representations.
Variants§
Integer(i64)
Float(f64)
UInteger(u64)
Byte(u8)
Int32(i32)
UInt32(u32)
Int16(i16)
UInt16(u16)
Int8(i8)
UInt8(u8)
Implementations§
Source§impl Numeric
impl Numeric
Sourcepub fn to_string_lossy(&self) -> String
pub fn to_string_lossy(&self) -> String
Lossy string conversion for all numeric variants.
Sourcepub fn fits_in_i32(&self) -> bool
pub fn fits_in_i32(&self) -> bool
Check if this numeric value fits in i32 range
Sourcepub fn size_bytes(&self) -> usize
pub fn size_bytes(&self) -> usize
Memory size in bytes
Sourcepub fn format_to(&self, dest: &mut dyn IDestination)
pub fn format_to(&self, dest: &mut dyn IDestination)
Formats this numeric value directly into an IDestination without heap allocation.
Trait Implementations§
impl StructuralPartialEq for Numeric
Auto Trait Implementations§
impl Freeze for Numeric
impl RefUnwindSafe for Numeric
impl Send for Numeric
impl Sync for Numeric
impl Unpin for Numeric
impl UnsafeUnpin for Numeric
impl UnwindSafe for Numeric
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