Struct rhai::FloatWrapper[][src]

pub struct FloatWrapper<F>(_);
Expand description

A type that wraps a floating-point number and implements Hash.

Not available under no_float.

Implementations

impl<F: Float> FloatWrapper<F>[src]

pub const MAX_NATURAL_FLOAT_FOR_DISPLAY: f32[src]

Maximum floating-point number for natural display before switching to scientific notation.

pub const MIN_NATURAL_FLOAT_FOR_DISPLAY: f32[src]

Minimum floating-point number for natural display before switching to scientific notation.

pub fn new(value: F) -> Self[src]

Trait Implementations

impl<F: Float> AsMut<F> for FloatWrapper<F>[src]

fn as_mut(&mut self) -> &mut F[src]

Performs the conversion.

impl<F: Float> AsRef<F> for FloatWrapper<F>[src]

fn as_ref(&self) -> &F[src]

Performs the conversion.

impl<F: Clone> Clone for FloatWrapper<F>[src]

fn clone(&self) -> FloatWrapper<F>[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<F: Float + Debug> Debug for FloatWrapper<F>[src]

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

Formats the value using the given formatter. Read more

impl<F: Float> Deref for FloatWrapper<F>[src]

type Target = F

The resulting type after dereferencing.

fn deref(&self) -> &Self::Target[src]

Dereferences the value.

impl<F: Float> DerefMut for FloatWrapper<F>[src]

fn deref_mut(&mut self) -> &mut Self::Target[src]

Mutably dereferences the value.

impl<F: Float + Display + LowerExp + From<f32>> Display for FloatWrapper<F>[src]

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

Formats the value using the given formatter. Read more

impl<F: Float> From<F> for FloatWrapper<F>[src]

fn from(value: F) -> Self[src]

Performs the conversion.

impl From<FloatWrapper<f64>> for Dynamic[src]

fn from(value: FloatWrapper<FLOAT>) -> Self[src]

Performs the conversion.

impl<F: Float + FromStr> FromStr for FloatWrapper<F>[src]

type Err = <F as FromStr>::Err

The associated error which can be returned from parsing.

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

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

impl Hash for FloatWrapper<FLOAT>[src]

fn hash<H: Hasher>(&self, state: &mut H)[src]

Feeds this value into the given Hasher. Read more

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

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

impl<F: PartialEq> PartialEq<FloatWrapper<F>> for FloatWrapper<F>[src]

fn eq(&self, other: &FloatWrapper<F>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &FloatWrapper<F>) -> bool[src]

This method tests for !=.

impl<F: PartialOrd> PartialOrd<FloatWrapper<F>> for FloatWrapper<F>[src]

fn partial_cmp(&self, other: &FloatWrapper<F>) -> Option<Ordering>[src]

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

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

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

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

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

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

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

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

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

impl<F: Copy> Copy for FloatWrapper<F>[src]

impl<F> StructuralPartialEq for FloatWrapper<F>[src]

Auto Trait Implementations

impl<F> RefUnwindSafe for FloatWrapper<F> where
    F: RefUnwindSafe

impl<F> Send for FloatWrapper<F> where
    F: Send

impl<F> Sync for FloatWrapper<F> where
    F: Sync

impl<F> Unpin for FloatWrapper<F> where
    F: Unpin

impl<F> UnwindSafe for FloatWrapper<F> where
    F: UnwindSafe

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> CallHasher for T where
    T: Hash + ?Sized
[src]

pub default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64 where
    H: Hash + ?Sized,
    B: BuildHasher
[src]

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

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

impl<T> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.