Struct rhai::FloatWrapper
source · pub struct FloatWrapper<F>(/* private fields */);
Expand description
(internals) A type that wraps a floating-point number and implements Hash
.
Exported under the internals
feature only.
Not available under no_float
.
Implementations§
source§impl<F: Float> FloatWrapper<F>
impl<F: Float> FloatWrapper<F>
sourcepub const MAX_NATURAL_FLOAT_FOR_DISPLAY: f32 = 9.99999982E+12f32
pub const MAX_NATURAL_FLOAT_FOR_DISPLAY: f32 = 9.99999982E+12f32
Maximum floating-point number for natural display before switching to scientific notation.
sourcepub const MIN_NATURAL_FLOAT_FOR_DISPLAY: f32 = 9.99999982E-14f32
pub const MIN_NATURAL_FLOAT_FOR_DISPLAY: f32 = 9.99999982E-14f32
Minimum floating-point number for natural display before switching to scientific notation.
sourcepub const fn new(value: F) -> Self
pub const fn new(value: F) -> Self
Create a new FloatWrapper
.
Trait Implementations§
source§impl<F: Float> AsMut<F> for FloatWrapper<F>
impl<F: Float> AsMut<F> for FloatWrapper<F>
source§impl<F: Float> AsRef<F> for FloatWrapper<F>
impl<F: Float> AsRef<F> for FloatWrapper<F>
source§impl<F: Clone> Clone for FloatWrapper<F>
impl<F: Clone> Clone for FloatWrapper<F>
source§fn clone(&self) -> FloatWrapper<F>
fn clone(&self) -> FloatWrapper<F>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<F: Float> Deref for FloatWrapper<F>
impl<F: Float> Deref for FloatWrapper<F>
source§impl<F: Float> DerefMut for FloatWrapper<F>
impl<F: Float> DerefMut for FloatWrapper<F>
source§impl<F: Float> From<F> for FloatWrapper<F>
impl<F: Float> From<F> for FloatWrapper<F>
source§impl From<FloatWrapper<f64>> for Dynamic
impl From<FloatWrapper<f64>> for Dynamic
source§fn from(value: FloatWrapper<FLOAT>) -> Self
fn from(value: FloatWrapper<FLOAT>) -> Self
Converts to this type from the input type.
source§impl Hash for FloatWrapper<FLOAT>
impl Hash for FloatWrapper<FLOAT>
source§impl<F: PartialEq> PartialEq for FloatWrapper<F>
impl<F: PartialEq> PartialEq for FloatWrapper<F>
source§fn eq(&self, other: &FloatWrapper<F>) -> bool
fn eq(&self, other: &FloatWrapper<F>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<F: PartialOrd> PartialOrd for FloatWrapper<F>
impl<F: PartialOrd> PartialOrd for FloatWrapper<F>
source§fn partial_cmp(&self, other: &FloatWrapper<F>) -> Option<Ordering>
fn partial_cmp(&self, other: &FloatWrapper<F>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
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 moreimpl<F: Copy> Copy for FloatWrapper<F>
impl<F: Eq> Eq for FloatWrapper<F>
impl<F> StructuralPartialEq for FloatWrapper<F>
Auto Trait Implementations§
impl<F> Freeze for FloatWrapper<F>where
F: Freeze,
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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Variant for T
impl<T> Variant for T
source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert this
Variant
trait object to &mut dyn Any
.source§fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
Convert this
Variant
trait object to Box<dyn Any>
.