Struct LitFloat

pub struct LitFloat { /* private fields */ }

A floating point literal: 1f64 or 1.0e10f64.

Must be finite. May not be infinite or NaN.

Implementations

impl LitFloat

fn new(repr: &str, span: Span) -> Self
fn base10_digits(&self) -> &str
fn base10_parse<N>(&self) -> Result<N>
where
    N: FromStr,
    N::Err: Display,
fn suffix(&self) -> &str
fn span(&self) -> Span
fn set_span(&mut self, span: Span)
fn token(&self) -> Literal

Trait Implementations

impl Clone for LitFloat

fn clone(&self) -> Self

impl Display for LitFloat

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

impl Parse for LitFloat

fn parse(input: ParseStream<'_>) -> Result<Self>

impl ToTokens for LitFloat

fn to_tokens(&self, tokens: &mut TokenStream)

impl Token for LitFloat

Auto Trait Implementations

impl !Send for LitFloat

impl !Sync for LitFloat

impl Freeze for LitFloat

impl RefUnwindSafe for LitFloat

impl Unpin for LitFloat

impl UnsafeUnpin for LitFloat

impl UnwindSafe for LitFloat

Blanket Implementations

impl<T> Any for LitFloat where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for LitFloat where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for LitFloat where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> CloneToUninit for LitFloat where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for LitFloat

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Spanned for LitFloat where T: Spanned + ?Sized,

fn span(&self) -> Span

impl<T> ToOwned for LitFloat where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T> ToString for LitFloat where T: Display + ?Sized,

fn to_string(&self) -> String

impl<T, U> Into<U> for LitFloat where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for LitFloat where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for LitFloat where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>