Enum wast::lexer::Float

source ·
pub enum Float<'a> {
    Nan {
        val: Option<Cow<'a, str>>,
        negative: bool,
    },
    Inf {
        negative: bool,
    },
    Val {
        hex: bool,
        integral: Cow<'a, str>,
        decimal: Option<Cow<'a, str>>,
        exponent: Option<Cow<'a, str>>,
    },
}
Expand description

Possible parsed float values

Variants§

§

Nan

A float NaN representation

Fields

§val: Option<Cow<'a, str>>

The specific bits to encode for this float, optionally

§negative: bool

Whether or not this is a negative NaN or not.

§

Inf

An float infinite representation,

Fields

§negative: bool
§

Val

A parsed and separated floating point value

Fields

§hex: bool

Whether or not the integral and decimal are specified in hex

§integral: Cow<'a, str>

The float parts before the .

§decimal: Option<Cow<'a, str>>

The float parts after the .

§exponent: Option<Cow<'a, str>>

The exponent to multiple this integral.decimal portion of the float by. If hex is true this is 2^exponent and otherwise it’s 10^exponent

Trait Implementations§

source§

impl<'a> Debug for Float<'a>

source§

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

Formats the value using the given formatter. Read more
source§

impl<'a> PartialEq for Float<'a>

source§

fn eq(&self, other: &Float<'a>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> Eq for Float<'a>

source§

impl<'a> StructuralPartialEq for Float<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for Float<'a>

§

impl<'a> RefUnwindSafe for Float<'a>

§

impl<'a> Send for Float<'a>

§

impl<'a> Sync for Float<'a>

§

impl<'a> Unpin for Float<'a>

§

impl<'a> UnwindSafe for Float<'a>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

source§

fn into(self) -> U

Calls U::from(self).

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

source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

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

Performs the conversion.