[][src]Struct hexponent::FloatLiteral

pub struct FloatLiteral { /* fields omitted */ }

Represents a floating point literal

This struct is a representation of the text, that can be used to convert to both single- and double-precision floats.

FloatLiteral is not Copy-able because it contains a vector of the digits from the source data.


impl FloatLiteral[src]

pub fn convert<F: FPFormat>(self) -> ConversionResult<F>[src]

Convert the self to an f32 or f64 and return the precision of the conversion.

pub fn from_bytes(data: &[u8]) -> Result<FloatLiteral, ParseError>[src]

Parse a slice of bytes into a FloatLiteral.

This is based on hexadecimal floating constants in the C11 specification, section

Trait Implementations

impl Clone for FloatLiteral[src]

impl Debug for FloatLiteral[src]

impl From<FloatLiteral> for f32[src]

impl From<FloatLiteral> for f64[src]

impl FromStr for FloatLiteral[src]

type Err = ParseError

The associated error which can be returned from parsing.

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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.