[][src]Enum ucum::ast::AST

pub enum AST<'a> {
    Factor(&'a str),
    Unit {
        label: &'a [u8],
        exponent: i8,
        annotation: Option<&'a [u8]>,
    },
    Product(Box<AST<'a>>, Box<AST<'a>>),
    Division(Box<AST<'a>>, Box<AST<'a>>),
}

Variants

Factor(&'a str)
Unit

Fields of Unit

label: &'a [u8]exponent: i8annotation: Option<&'a [u8]>
Product(Box<AST<'a>>, Box<AST<'a>>)
Division(Box<AST<'a>>, Box<AST<'a>>)

Implementations

impl<'a> AST<'a>[src]

pub fn factor(txt: &[u8]) -> Box<AST>[src]

pub fn unit(
    label: &'a [u8],
    exponent: i8,
    annotation: Option<&'a [u8]>
) -> Box<AST<'a>>
[src]

pub fn product(lhs: Box<AST<'a>>, rhs: Box<AST<'a>>) -> Box<AST<'a>>[src]

pub fn division(lhs: Box<AST<'a>>, rhs: Box<AST<'a>>) -> Box<AST<'a>>[src]

pub fn make_quantity<T>(
    &self,
    value: T,
    system: &UnitSystem<T>
) -> UcumResult<'a, Quantity<T>> where
    T: Clone + Div<T, Output = T> + From<i32> + From<T> + FromStr + Mul<T, Output = T> + MulAssign,
    <T as FromStr>::Err: Error + 'static, 
[src]

pub fn as_unit_quantity<T>(
    &self,
    system: &UnitSystem<T>
) -> UcumResult<'a, Quantity<T>> where
    T: Clone + Div<T, Output = T> + From<i32> + From<T> + FromStr + Mul<T, Output = T> + MulAssign,
    <T as FromStr>::Err: Error + 'static, 
[src]

Trait Implementations

impl<'a> Clone for AST<'a>[src]

impl<'a> Debug for AST<'a>[src]

impl<'a> Eq for AST<'a>[src]

impl<'a> Hash for AST<'a>[src]

impl<'a> PartialEq<AST<'a>> for AST<'a>[src]

impl<'a> StructuralEq for AST<'a>[src]

impl<'a> StructuralPartialEq for AST<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for AST<'a>

impl<'a> Send for AST<'a>

impl<'a> Sync for AST<'a>

impl<'a> Unpin for AST<'a>

impl<'a> UnwindSafe for AST<'a>

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.