pub struct Number<'a> {
pub value: f64,
pub lexeme: Option<&'a str>,
}Expand description
A number as the source spelled it and as a machine value.
lexeme is the source text when the source could hand it over (the
rule-event adapter reads it off the token; the JSON Lines source likewise),
else None, and the renderer falls back to the shortest round-trip form
of value. Keeping both is how 50.25 stays 50.25 and how a number
beyond f64’s exact range keeps its digits.
Fields§
§value: f64§lexeme: Option<&'a str>Implementations§
Trait Implementations§
impl<'a> Copy 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> UnsafeUnpin 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