Enum syn::ConstExpr [] [src]

pub enum ConstExpr {
    Call(Box<ConstExpr>, Vec<ConstExpr>),
    Binary(BinOpBox<ConstExpr>, Box<ConstExpr>),
    Unary(UnOpBox<ConstExpr>),
    Lit(Lit),
    Cast(Box<ConstExpr>, Box<Ty>),
    Path(Path),
    Index(Box<ConstExpr>, Box<ConstExpr>),
    Paren(Box<ConstExpr>),
    Other(Other),
}

Variants

A function call

The first field resolves to the function itself, and the second field is the list of arguments

A binary operation (For example: a + b, a * b)

A unary operation (For example: !x, *x)

A literal (For example: 1, "foo")

A cast (foo as f64)

Variable reference, possibly containing :: and/or type parameters, e.g. foo::bar::.

An indexing operation (foo[2])

No-op: used solely so we can pretty-print faithfully

If compiling with full support for expression syntax, any expression is allowed

Trait Implementations

impl ToTokens for ConstExpr
[src]

Write self to the given Tokens. Read more

impl Debug for ConstExpr
[src]

Formats the value using the given formatter.

impl Clone for ConstExpr
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Eq for ConstExpr
[src]

impl PartialEq for ConstExpr
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Hash for ConstExpr
[src]

Feeds this value into the state given, updating the hasher as necessary.

Feeds a slice of this type into the state provided.