[][src]Struct civil::units::conversions::Table

pub struct Table {
    pub convert: HashMap<(&'static str, &'static str), f32>,
}

Table contains all of our unit conversions within the field convert

Fields

convert: HashMap<(&'static str, &'static str), f32>

Convert is the 'meat' of our conversion table. It accepts a tuple of string slices as a key and returns a conversion factor. This should feel the same as having a generic function that knows how to convert between units.

Methods

impl Table[src]

pub fn new() -> Table[src]

New creates our unit conversion table. The table has only one field convert which is our HashMap. The hashmap and all the conversions are generated when this is done.

Trait Implementations

impl Debug for Table[src]

Auto Trait Implementations

impl Send for Table

impl Sync for Table

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]