[][src]Struct cpc::Number

pub struct Number {
    pub value: d128,
    pub unit: Unit,
}

A number with a Unit.

Example:

use cpc::{eval,Number};
use cpc::units::Unit;
use decimal_fixes_mirror::d128;
 
let x = Number {
  value: d128!(100),
  unit: Unit::Meter,
};

Fields

value: d128

The number part of a Number struct

unit: Unit

The unit of a Number struct. This can be NoType

Implementations

impl Number[src]

pub fn new(value: d128, unit: Unit) -> Number[src]

Trait Implementations

impl Clone for Number[src]

impl Debug for Number[src]

Auto Trait Implementations

impl RefUnwindSafe for Number

impl Send for Number

impl Sync for Number

impl Unpin for Number

impl UnwindSafe for Number

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.