pub struct Fraction64 { /* private fields */ }Expand description
Represents a fraction value.
This is an f64 value under the hood, which is in 0.0 .. 1.0
range.
Implementations§
Source§impl Fraction64
impl Fraction64
Sourcepub const unsafe fn new_unchecked(value: f64) -> Self
pub const unsafe fn new_unchecked(value: f64) -> Self
Creates a new Fraction64 instance out of passed value.
§Safety
This function does not verify that value is in the expected
0.0 .. 1.0 range.
Sourcepub const fn new(value: f64) -> Result<Self, FractionError>
pub const fn new(value: f64) -> Result<Self, FractionError>
Creates a new Fraction64 instance out of passed value.
§Errors
Return FractionError::NotAFraction if the passed value
is outside of 0.0 .. 1.0 range.
Trait Implementations§
Source§impl Clone for Fraction64
impl Clone for Fraction64
Source§fn clone(&self) -> Fraction64
fn clone(&self) -> Fraction64
Returns a duplicate 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 Debug for Fraction64
impl Debug for Fraction64
Source§impl PartialEq for Fraction64
impl PartialEq for Fraction64
Source§impl PartialOrd for Fraction64
impl PartialOrd for Fraction64
impl Copy for Fraction64
impl StructuralPartialEq for Fraction64
Auto Trait Implementations§
impl Freeze for Fraction64
impl RefUnwindSafe for Fraction64
impl Send for Fraction64
impl Sync for Fraction64
impl Unpin for Fraction64
impl UnsafeUnpin for Fraction64
impl UnwindSafe for Fraction64
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