Trait icu::experimental::units::convertible::Convertible

source ·
pub trait Convertible: Clone {
    // Required methods
    fn add_refs(&self, other: &Self) -> Self;
    fn mul_refs(&self, other: &Self) -> Self;
    fn from_ratio_bigint(ratio: Ratio<BigInt>) -> Option<Self>;
    fn reciprocal(&self) -> Self;
}
Expand description

A trait for types that can be converted between two units.

Required Methods§

source

fn add_refs(&self, other: &Self) -> Self

Adds two values by reference, avoiding data cloning.

source

fn mul_refs(&self, other: &Self) -> Self

Multiplies two values by reference, avoiding data cloning.

source

fn from_ratio_bigint(ratio: Ratio<BigInt>) -> Option<Self>

Converts a Ratio<BigInt> to the implementing type.

source

fn reciprocal(&self) -> Self

Returns the reciprocal of the implementing type.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Convertible for f64

source§

fn mul_refs(&self, other: &f64) -> f64

source§

fn add_refs(&self, other: &f64) -> f64

source§

fn from_ratio_bigint(ratio: Ratio<BigInt>) -> Option<f64>

source§

fn reciprocal(&self) -> f64

source§

impl Convertible for Ratio<BigInt>

Implementors§