icu_experimental::units::convertible

Trait 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Convertible for f64

Source§

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

Source§

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

Source§

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

Source§

fn reciprocal(&self) -> Self

Source§

impl Convertible for Ratio<BigInt>

Source§

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

Source§

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

Source§

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

Source§

fn reciprocal(&self) -> Self

Implementors§