Struct icu_capi::units_converter::ffi::UnitsConverter
source · pub struct UnitsConverter(pub UnitsConverter<f64>);
Expand description
An ICU4X Units Converter object, capable of converting between two MeasureUnit
s.
You can create an instance of this object using UnitsConverterFactory
by calling the converter
method.
Tuple Fields§
§0: UnitsConverter<f64>
Implementations§
source§impl UnitsConverter
impl UnitsConverter
sourcepub fn convert_double(&self, value: f64) -> f64
pub fn convert_double(&self, value: f64) -> f64
Converts the input value from the input unit to the output unit (that have been used to create this converter). NOTE: The conversion using floating-point operations is not as accurate as the conversion using ratios.
sourcepub fn clone(&self) -> Box<Self>
pub fn clone(&self) -> Box<Self>
Clones the current UnitsConverter
object.
Auto Trait Implementations§
impl Freeze for UnitsConverter
impl RefUnwindSafe for UnitsConverter
impl Send for UnitsConverter
impl Sync for UnitsConverter
impl Unpin for UnitsConverter
impl UnwindSafe for UnitsConverter
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more