Struct xsd_types::value::Float

source ·
#[repr(transparent)]
pub struct Float(_);

Implementations§

source§

impl Float

source

pub const NEG_INFINITY: Self = _

source

pub const INFINITY: Self = _

source

pub const MIN: Self = _

source

pub const MAX: Self = _

source

pub const NAN: Self = _

source

pub fn new(f: f32) -> Self

source

pub fn is_nan(&self) -> bool

Returns true if this value is NaN.

source

pub fn is_finite(&self) -> bool

Returns true if this number is neither infinite nor NaN.

source

pub fn is_infinite(&self) -> bool

Returns true if this value is positive infinity or negative infinity, and false otherwise.

source

pub fn is_positive(&self) -> bool

Returns true if self has a positive sign, including +0.0, NaNs with positive sign bit and positive infinity.

Note that IEEE 754 doesn’t assign any meaning to the sign bit in case of a NaN, and as Rust doesn’t guarantee that the bit pattern of NaNs are conserved over arithmetic operations, the result of is_positive on a NaN might produce an unexpected result in some cases. See explanation of NaN as a special value for more info.

source

pub fn is_negative(&self) -> bool

Returns false if self has a negative sign, including -0.0, NaNs with negative sign bit and negative infinity.

Note that IEEE 754 doesn’t assign any meaning to the sign bit in case of a NaN, and as Rust doesn’t guarantee that the bit pattern of NaNs are conserved over arithmetic operations, the result of is_negative on a NaN might produce an unexpected result in some cases. See explanation of NaN as a special value for more info.

source

pub const fn into_f32(self) -> f32

Converts this value into a f32.

Trait Implementations§

source§

impl Add<Float> for Float

§

type Output = Float

The resulting type after applying the + operator.
source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
source§

impl AsRef<f32> for Float

source§

fn as_ref(&self) -> &f32

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Borrow<f32> for Float

source§

fn borrow(&self) -> &f32

Immutably borrows from an owned value. Read more
source§

impl Clone for Float

source§

fn clone(&self) -> Float

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Float

source§

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

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

impl Display for Float

source§

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

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

impl Div<Float> for Float

§

type Output = Float

The resulting type after applying the / operator.
source§

fn div(self, rhs: Self) -> Self::Output

Performs the / operation. Read more
source§

impl<'a> From<&'a Float> for Float

source§

fn from(value: &'a Float) -> Self

Converts to this type from the input type.
source§

impl From<Float> for f32

source§

fn from(value: Float) -> Self

Converts to this type from the input type.
source§

impl From<Float> for f64

source§

fn from(value: Float) -> Self

Converts to this type from the input type.
source§

impl From<FloatBuf> for Float

source§

fn from(value: FloatBuf) -> Self

Converts to this type from the input type.
source§

impl From<f32> for Float

source§

fn from(value: f32) -> Self

Converts to this type from the input type.
source§

impl FromStr for Float

§

type Err = InvalidFloat

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl Hash for Float

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl LexicalFormOf<Float> for Float

source§

impl Mul<Float> for Float

§

type Output = Float

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Self) -> Self::Output

Performs the * operation. Read more
source§

impl Ord for Float

source§

fn cmp(&self, other: &Float) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl ParseRdf for Float

§

type LexicalForm = Float

source§

fn parse_rdf(lexical_value: &str) -> ParseRdfResult<Self, Self::LexicalForm>

source§

impl PartialEq<Float> for Float

source§

fn eq(&self, other: &Float) -> 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 PartialOrd<Float> for Float

source§

fn partial_cmp(&self, other: &Float) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Sub<Float> for Float

§

type Output = Float

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
source§

impl TryFrom<Float> for Decimal

§

type Error = NonDecimalFloat

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

fn try_from(value: Float) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl XsdDatatype for Float

source§

fn type_(&self) -> Datatype

Returns the XSD datatype that best describes the value.
source§

impl Copy for Float

source§

impl Eq for Float

source§

impl StructuralEq for Float

source§

impl StructuralPartialEq for Float

Auto Trait Implementations§

§

impl RefUnwindSafe for Float

§

impl Send for Float

§

impl Sync for Float

§

impl Unpin for Float

§

impl UnwindSafe for Float

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere 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 Twhere 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.