pub struct FiniteF32(/* private fields */);Expand description
An f32 guaranteed not to be non-finite (NaN or infinite).
Option<Self> is niche-optimized to the size of the primitive.
Implementations§
Source§impl FiniteF32
impl FiniteF32
Sourcepub fn new(value: f32) -> Option<Self>
pub fn new(value: f32) -> Option<Self>
Creates a value if it is not non-finite (NaN or infinite), otherwise None.
Sourcepub unsafe fn new_unchecked(value: f32) -> Self
pub unsafe fn new_unchecked(value: f32) -> 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 FiniteF32
Source§impl<'de> Deserialize<'de> for FiniteF32
Available on crate feature serde only.
impl<'de> Deserialize<'de> for FiniteF32
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 FiniteF32
Source§impl Ord for FiniteF32
impl Ord for FiniteF32
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 FiniteF32
impl PartialOrd for FiniteF32
Auto Trait Implementations§
impl Forget for FiniteF32
impl Freeze for FiniteF32
impl Move for FiniteF32
impl RefUnwindSafe for FiniteF32
impl Send for FiniteF32
impl Sync for FiniteF32
impl Unpin for FiniteF32
impl UnsafeUnpin for FiniteF32where
NonZeroU32Inner: UnsafeUnpin,
impl UnwindSafe for FiniteF32
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