pub struct ParsedSafeDec<const D: usize> {
pub raw: SafeInt,
pub decimals: usize,
pub span: Span,
}Expand description
Parsed representation of a fixed-scale decimal literal.
Useful for inspecting the raw scaled value and source span after parsing.
Fields§
§raw: SafeIntThe scaled integer backing the parsed decimal.
decimals: usizeNumber of decimal places parsed (should equal D when valid).
span: SpanSource span of the parsed literal.
Trait Implementations§
Source§impl<const D: usize> Clone for ParsedSafeDec<D>
impl<const D: usize> Clone for ParsedSafeDec<D>
Source§fn clone(&self) -> ParsedSafeDec<D>
fn clone(&self) -> ParsedSafeDec<D>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<const D: usize> Debug for ParsedSafeDec<D>
impl<const D: usize> Debug for ParsedSafeDec<D>
Source§impl<const D: usize> Display for ParsedSafeDec<D>
impl<const D: usize> Display for ParsedSafeDec<D>
Source§impl<const D: usize> FromStr for ParsedSafeDec<D>
impl<const D: usize> FromStr for ParsedSafeDec<D>
Source§impl<const D: usize> Hash for ParsedSafeDec<D>
impl<const D: usize> Hash for ParsedSafeDec<D>
Source§impl<const D: usize> Parsable for ParsedSafeDec<D>
impl<const D: usize> Parsable for ParsedSafeDec<D>
Source§fn parse(stream: &mut ParseStream) -> Result<Self>
fn parse(stream: &mut ParseStream) -> Result<Self>
Attempts to parse the specified string into a value of type
T.Source§fn parse_value(value: Self, stream: &mut ParseStream) -> Result<Self, Error>
fn parse_value(value: Self, stream: &mut ParseStream) -> Result<Self, Error>
Attempts to parse a specific value of type
T from the ParseStream.Source§impl<const D: usize> PartialEq for ParsedSafeDec<D>
impl<const D: usize> PartialEq for ParsedSafeDec<D>
Source§impl<const D: usize> Spanned for ParsedSafeDec<D>
impl<const D: usize> Spanned for ParsedSafeDec<D>
impl<const D: usize> Eq for ParsedSafeDec<D>
impl<const D: usize> StructuralPartialEq for ParsedSafeDec<D>
Auto Trait Implementations§
impl<const D: usize> Freeze for ParsedSafeDec<D>
impl<const D: usize> RefUnwindSafe for ParsedSafeDec<D>
impl<const D: usize> !Send for ParsedSafeDec<D>
impl<const D: usize> !Sync for ParsedSafeDec<D>
impl<const D: usize> Unpin for ParsedSafeDec<D>
impl<const D: usize> UnwindSafe for ParsedSafeDec<D>
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Peekable for Twhere
T: Parsable,
impl<T> Peekable for Twhere
T: Parsable,
Source§fn peek(stream: &ParseStream) -> bool
fn peek(stream: &ParseStream) -> bool
Returns a boolean indicating whether the
ParseStream can parse the specified type
at the current parsing position.Source§fn peek_value(value: T, stream: &ParseStream) -> bool
fn peek_value(value: T, stream: &ParseStream) -> bool
Returns a boolean indicating whether the
ParseStream can parse the specified value
at the current parsing position.