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: &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§