[][src]Enum math_ast::AST

pub enum AST<T> {
    Number(T),
    Factorial(Box<AST<T>>),
    Plus(Box<AST<T>>, Box<AST<T>>),
    Minus(Box<AST<T>>, Box<AST<T>>),
    Times(Box<AST<T>>, Box<AST<T>>),
    Divide(Box<AST<T>>, Box<AST<T>>),
    Power(Box<AST<T>>, Box<AST<T>>),
    Surd(Box<AST<T>>, Box<AST<T>>),
    Connect(Box<AST<T>>, Box<AST<T>>),
}

Variants

Number(T)
Factorial(Box<AST<T>>)
Plus(Box<AST<T>>, Box<AST<T>>)
Minus(Box<AST<T>>, Box<AST<T>>)
Times(Box<AST<T>>, Box<AST<T>>)
Divide(Box<AST<T>>, Box<AST<T>>)
Power(Box<AST<T>>, Box<AST<T>>)
Surd(Box<AST<T>>, Box<AST<T>>)
Connect(Box<AST<T>>, Box<AST<T>>)

Implementations

impl<T> AST<T> where
    T: Clone + Factorial + Add<Output = T> + Sub<Output = T> + Mul<Output = T> + Div<Output = T> + Pow<T, Output = T> + Surd<Output = T> + Connect<Output = T>, 
[src]

pub fn eval(self) -> T[src]

pub fn unwrap(self) -> T[src]

Trait Implementations

impl<T> Add<AST<T>> for AST<T>[src]

type Output = AST<T>

The resulting type after applying the + operator.

impl<T: Clone> Clone for AST<T>[src]

impl<T: Debug> Debug for AST<T>[src]

impl<T: Clone + Display> Display for AST<T>[src]

impl<T> Div<AST<T>> for AST<T>[src]

type Output = AST<T>

The resulting type after applying the / operator.

impl<T: Eq> Eq for AST<T>[src]

impl<T: Hash> Hash for AST<T>[src]

impl<T> Mul<AST<T>> for AST<T>[src]

type Output = AST<T>

The resulting type after applying the * operator.

impl<T: Ord> Ord for AST<T>[src]

impl<T: PartialEq> PartialEq<AST<T>> for AST<T>[src]

impl<T: PartialOrd> PartialOrd<AST<T>> for AST<T>[src]

impl<T> Pow<AST<T>> for AST<T>[src]

type Output = AST<T>

The result after applying the operator.

impl<T> StructuralEq for AST<T>[src]

impl<T> StructuralPartialEq for AST<T>[src]

impl<T> Sub<AST<T>> for AST<T>[src]

type Output = AST<T>

The resulting type after applying the - operator.

Auto Trait Implementations

impl<T> RefUnwindSafe for AST<T> where
    T: RefUnwindSafe

impl<T> Send for AST<T> where
    T: Send

impl<T> Sync for AST<T> where
    T: Sync

impl<T> Unpin for AST<T> where
    T: Unpin

impl<T> UnwindSafe for AST<T> where
    T: UnwindSafe

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> ToString for T where
    T: Display + ?Sized
[src]

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.