[][src]Enum libslide::grammar::statement::Expr

pub enum Expr {
    Const(f64),
    Var(InternedStr),
    BinaryExpr(BinaryExpr<RcExpr>),
    UnaryExpr(UnaryExpr<RcExpr>),
    Parend(RcExpr),
    Bracketed(RcExpr),
}

An expression.

Variants

Const(f64)

A constant.

Var(InternedStr)

A variable.

BinaryExpr(BinaryExpr<RcExpr>)

A binary expression.

UnaryExpr(UnaryExpr<RcExpr>)

A unary expression.

Parend(RcExpr)

An expression wrapped in parentheses.

Bracketed(RcExpr)

An expression wrapped in brackets.

Implementations

impl Expr[src]

pub(crate) fn complexity(&self) -> u8[src]

pub fn get_const(&self) -> Option<f64>[src]

Gets the constant value stored in this expression, if any.

pub fn get_var(&self) -> Option<InternedStr>[src]

Gets the variable value stored in this expression, if any.

Trait Implementations

impl AsRef<Expr> for RcExpr[src]

impl Clone for Expr[src]

impl Debug for Expr[src]

impl Display for Expr[src]

impl Emit for Expr[src]

impl Eq for Expr[src]

impl From<f64> for Expr[src]

impl Grammar for Expr[src]

impl Hash for Expr[src]

impl Ord for Expr[src]

impl PartialEq<Expr> for Expr[src]

impl PartialOrd<Expr> for Expr[src]

impl StructuralPartialEq for Expr[src]

Auto Trait Implementations

impl RefUnwindSafe for Expr

impl Send for Expr

impl Sync for Expr

impl Unpin for Expr

impl UnwindSafe for Expr

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.