pub struct FiniteF64(/* private fields */);Expand description
An f64 guaranteed not to be non-finite (NaN or infinite).
Option<Self> is niche-optimized to the size of the primitive.
Implementations§
Source§impl FiniteF64
impl FiniteF64
Sourcepub fn new(value: f64) -> Option<Self>
pub fn new(value: f64) -> Option<Self>
Creates a value if it is not non-finite (NaN or infinite), otherwise None.
Sourcepub unsafe fn new_unchecked(value: f64) -> Self
pub unsafe fn new_unchecked(value: f64) -> Self
Creates a value without checking that it is not non-finite (NaN or infinite).
§Safety
value must not be non-finite (NaN or infinite).
Trait Implementations§
impl Copy for FiniteF64
Source§impl<'de> Deserialize<'de> for FiniteF64
Available on crate feature serde only.
impl<'de> Deserialize<'de> for FiniteF64
Available on crate feature
serde only.Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for FiniteF64
Source§impl Ord for FiniteF64
impl Ord for FiniteF64
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for FiniteF64
impl PartialOrd for FiniteF64
Auto Trait Implementations§
impl Forget for FiniteF64
impl Freeze for FiniteF64
impl Move for FiniteF64
impl RefUnwindSafe for FiniteF64
impl Send for FiniteF64
impl Sync for FiniteF64
impl Unpin for FiniteF64
impl UnsafeUnpin for FiniteF64where
NonZeroU64Inner: UnsafeUnpin,
impl UnwindSafe for FiniteF64
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