pub enum Float {
F32(f32),
F64(f64),
}
Expand description
A floating-point number.
Variants§
Trait Implementations§
source§impl AddAssign for Float
impl AddAssign for Float
source§fn add_assign(&mut self, other: Float)
fn add_assign(&mut self, other: Float)
Performs the
+=
operation. Read moresource§impl<'de> Deserialize<'de> for Float
impl<'de> Deserialize<'de> for Float
source§fn deserialize<D>(
deserializer: D,
) -> Result<Float, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Float, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl DivAssign for Float
impl DivAssign for Float
source§fn div_assign(&mut self, other: Float)
fn div_assign(&mut self, other: Float)
Performs the
/=
operation. Read moresource§impl FloatInstance for Float
impl FloatInstance for Float
source§fn is_infinite(&self) -> bool
fn is_infinite(&self) -> bool
source§impl FromStream for Float
impl FromStream for Float
§type Context = ()
type Context = ()
The decoding context of this type, useful in situations where the stream to be decoded
may be too large to hold in main memory. Read more
source§fn from_stream<'life0, 'async_trait, D>(
cxt: <Float as FromStream>::Context,
decoder: &'life0 mut D,
) -> Pin<Box<dyn Future<Output = Result<Float, <D as Decoder>::Error>> + Send + 'async_trait>>
fn from_stream<'life0, 'async_trait, D>( cxt: <Float as FromStream>::Context, decoder: &'life0 mut D, ) -> Pin<Box<dyn Future<Output = Result<Float, <D as Decoder>::Error>> + Send + 'async_trait>>
Parse this value using the given
Decoder
.source§impl GetSize for Float
impl GetSize for Float
source§fn get_heap_size(&self) -> usize
fn get_heap_size(&self) -> usize
Determines how many bytes this object occupies inside the heap. Read more
source§fn get_stack_size() -> usize
fn get_stack_size() -> usize
Determines how may bytes this object occupies inside the stack. Read more
source§impl<D> Hash<D> for Floatwhere
D: Digest,
impl<D> Hash<D> for Floatwhere
D: Digest,
source§fn hash(self) -> GenericArray<u8, <D as OutputSizeUser>::OutputSize>
fn hash(self) -> GenericArray<u8, <D as OutputSizeUser>::OutputSize>
Compute the SHA-2 hash of this value
source§impl<'en> IntoStream<'en> for Float
impl<'en> IntoStream<'en> for Float
source§impl MulAssign for Float
impl MulAssign for Float
source§fn mul_assign(&mut self, other: Float)
fn mul_assign(&mut self, other: Float)
Performs the
*=
operation. Read moresource§impl NumberInstance for Float
impl NumberInstance for Float
type Abs = Float
type Exp = Float
type Log = Float
type Round = Int
type Class = FloatType
source§fn class(&self) -> FloatType
fn class(&self) -> FloatType
Get an impl of
NumberClass
describing this number.source§fn into_type(self, dtype: FloatType) -> Float
fn into_type(self, dtype: FloatType) -> Float
Cast this number into the specified
NumberClass
.source§fn log<N>(self, base: N) -> <Float as NumberInstance>::Log
fn log<N>(self, base: N) -> <Float as NumberInstance>::Log
Compute the logarithm of this number with respect to the given
base
.source§fn round(self) -> <Float as NumberInstance>::Round
fn round(self) -> <Float as NumberInstance>::Round
Return this number rounded to the nearest integer.
source§impl PartialOrd for Float
impl PartialOrd for Float
source§impl RealInstance for Float
impl RealInstance for Float
source§impl RemAssign for Float
impl RemAssign for Float
source§fn rem_assign(&mut self, other: Float)
fn rem_assign(&mut self, other: Float)
Performs the
%=
operation. Read moresource§impl Serialize for Float
impl Serialize for Float
source§fn serialize<S>(
&self,
s: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
s: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
source§impl SubAssign for Float
impl SubAssign for Float
source§fn sub_assign(&mut self, other: Float)
fn sub_assign(&mut self, other: Float)
Performs the
-=
operation. Read moresource§impl TryCastFrom<Value> for Float
impl TryCastFrom<Value> for Float
source§fn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if
value
can be cast into Self
.source§fn opt_cast_from(value: Value) -> Option<Self>
fn opt_cast_from(value: Value) -> Option<Self>
Returns
Some(Self)
if the source value can be cast into Self
, otherwise None
.impl Copy for Float
impl Eq for Float
Auto Trait Implementations§
impl Freeze for Float
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> 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<F> Match for F
impl<F> Match for F
source§fn matches<T>(&self) -> boolwhere
T: TryCastFrom<Self>,
fn matches<T>(&self) -> boolwhere
T: TryCastFrom<Self>,
Returns
true
if self
can be cast into the target type T
.source§impl<F, T> TryCastFrom<F> for Twhere
T: CastFrom<F>,
impl<F, T> TryCastFrom<F> for Twhere
T: CastFrom<F>,
source§fn can_cast_from(_: &F) -> bool
fn can_cast_from(_: &F) -> bool
Test if
value
can be cast into Self
.source§fn opt_cast_from(f: F) -> Option<T>
fn opt_cast_from(f: F) -> Option<T>
Returns
Some(Self)
if the source value can be cast into Self
, otherwise None
.source§impl<F, T> TryCastInto<T> for Fwhere
T: TryCastFrom<F>,
impl<F, T> TryCastInto<T> for Fwhere
T: TryCastFrom<F>,
source§fn can_cast_into(&self) -> bool
fn can_cast_into(&self) -> bool
Test if
self
can be cast into T
.source§fn opt_cast_into(self) -> Option<T>
fn opt_cast_into(self) -> Option<T>
Returns
Some(T)
if self
can be cast into T
, otherwise None
.source§fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err>where
OnErr: FnOnce(&Self) -> Err,
fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err>where
OnErr: FnOnce(&Self) -> Err,
Returns
Ok(T)
if self
can be cast into T
, otherwise calls on_err
.