pub struct ScaleRatio(/* private fields */);Implementations§
Source§impl ScaleRatio
impl ScaleRatio
Sourcepub const fn new(denominator: u32) -> Result<Self, MapScaleError>
pub const fn new(denominator: u32) -> Result<Self, MapScaleError>
Creates a scale ratio from a positive denominator.
§Errors
Returns MapScaleError::ZeroScaleRatio when denominator is zero.
pub const fn denominator(self) -> u32
Trait Implementations§
Source§impl Clone for ScaleRatio
impl Clone for ScaleRatio
Source§fn clone(&self) -> ScaleRatio
fn clone(&self) -> ScaleRatio
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 ScaleRatio
impl Debug for ScaleRatio
Source§impl Display for ScaleRatio
impl Display for ScaleRatio
Source§impl Hash for ScaleRatio
impl Hash for ScaleRatio
Source§impl Ord for ScaleRatio
impl Ord for ScaleRatio
Source§fn cmp(&self, other: &ScaleRatio) -> Ordering
fn cmp(&self, other: &ScaleRatio) -> Ordering
1.21.0 · 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
Source§impl PartialEq for ScaleRatio
impl PartialEq for ScaleRatio
Source§impl PartialOrd for ScaleRatio
impl PartialOrd for ScaleRatio
impl Copy for ScaleRatio
impl Eq for ScaleRatio
impl StructuralPartialEq for ScaleRatio
Auto Trait Implementations§
impl Freeze for ScaleRatio
impl RefUnwindSafe for ScaleRatio
impl Send for ScaleRatio
impl Sync for ScaleRatio
impl Unpin for ScaleRatio
impl UnsafeUnpin for ScaleRatio
impl UnwindSafe for ScaleRatio
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