pub struct Fraction32 { /* private fields */ }Expand description
Represents a fraction value.
This is an f32 value under the hood, which is in 0.0 .. 1.0
range.
Implementations§
Source§impl Fraction32
impl Fraction32
Sourcepub const unsafe fn new_unchecked(value: f32) -> Self
pub const unsafe fn new_unchecked(value: f32) -> Self
Creates a new Fraction32 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: f32) -> Result<Self, FractionError>
pub const fn new(value: f32) -> Result<Self, FractionError>
Creates a new Fraction32 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 Fraction32
impl Clone for Fraction32
Source§fn clone(&self) -> Fraction32
fn clone(&self) -> Fraction32
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 Fraction32
impl Debug for Fraction32
Source§impl PartialEq for Fraction32
impl PartialEq for Fraction32
Source§impl PartialOrd for Fraction32
impl PartialOrd for Fraction32
impl Copy for Fraction32
impl StructuralPartialEq for Fraction32
Auto Trait Implementations§
impl Freeze for Fraction32
impl RefUnwindSafe for Fraction32
impl Send for Fraction32
impl Sync for Fraction32
impl Unpin for Fraction32
impl UnsafeUnpin for Fraction32
impl UnwindSafe for Fraction32
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