pub struct Conversion {
pub from_unit: &'static str,
pub to_unit: &'static str,
pub factor: f64,
pub offset: f64,
}Expand description
A linear or affine conversion between two unit labels.
Fields§
§from_unit: &'static str§to_unit: &'static str§factor: f64§offset: f64Implementations§
Source§impl Conversion
impl Conversion
Sourcepub const fn linear(
from_unit: &'static str,
to_unit: &'static str,
factor: f64,
) -> Self
pub const fn linear( from_unit: &'static str, to_unit: &'static str, factor: f64, ) -> Self
Creates a linear conversion with no offset.
Trait Implementations§
Source§impl Clone for Conversion
impl Clone for Conversion
Source§fn clone(&self) -> Conversion
fn clone(&self) -> Conversion
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 Conversion
impl Debug for Conversion
Source§impl PartialEq for Conversion
impl PartialEq for Conversion
Source§fn eq(&self, other: &Conversion) -> bool
fn eq(&self, other: &Conversion) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for Conversion
impl StructuralPartialEq for Conversion
Auto Trait Implementations§
impl Freeze for Conversion
impl RefUnwindSafe for Conversion
impl Send for Conversion
impl Sync for Conversion
impl Unpin for Conversion
impl UnsafeUnpin for Conversion
impl UnwindSafe for Conversion
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