Enum Expr
pub(in meta) enum Expr {
Show 18 variants
Ident {
name: String,
span: SourceSpan,
},
Int(i64),
Number(NumberLiteral),
String(String),
Bool(bool),
Array {
items: Vec<Expr>,
span: SourceSpan,
},
Tuple {
items: Vec<Expr>,
span: SourceSpan,
},
StructLit {
name: String,
fields: Vec<NamedExprField>,
span: SourceSpan,
},
Call {
callee: Box<Expr>,
args: Vec<CallArg>,
span: SourceSpan,
},
IntrinsicCall {
name: String,
args: Vec<CallArg>,
span: SourceSpan,
},
Field {
base: Box<Expr>,
field: String,
},
Index {
base: Box<Expr>,
index: Box<Expr>,
},
SliceRange {
base: Box<Expr>,
start: Option<Box<Expr>>,
end: Option<Box<Expr>>,
},
Prefix {
op: PrefixOp,
value: Box<Expr>,
},
Binary {
op: BinaryOp,
lhs: Box<Expr>,
rhs: Box<Expr>,
},
Relational {
op: RelationalOp,
lhs: Box<Expr>,
rhs: Box<Expr>,
},
Block(Block),
Splice(Box<MetaExpr>),
}Expand description
Runtime expression.
Variants§
Ident
Meta identifier reference.
Fields
span: SourceSpanSource span covering the identifier token.
Int(i64)
Legacy integer literal.
Number(NumberLiteral)
Numeric literal.
String(String)
String literal.
Bool(bool)
Boolean literal.
Array
Array literal expression.
Fields
span: SourceSpanSource span covering the full literal.
Tuple
Tuple literal expression.
Fields
span: SourceSpanSource span covering the full literal.
StructLit
Struct literal expression.
Fields
fields: Vec<NamedExprField>Field values supplied for the literal.
span: SourceSpanSource span covering the full literal.
Call
Function call expression.
Fields
span: SourceSpanSource span covering the full call.
IntrinsicCall
Builtin intrinsic call expression.
Fields
span: SourceSpanSource span covering the full intrinsic call.
Field
Field projection expression.
Fields
Index
Collection indexing expression.
Fields
SliceRange
Slice-range expression over an array or slice.
Fields
Prefix
Prefix operator expression.
Binary
Binary operator expression.
Fields
Relational
Relational operator expression.
Fields
op: RelationalOpRelational operator to apply.
Block(Block)
Nested block expression.
Splice(Box<MetaExpr>)
Meta splice inside quoted code.
Trait Implementations§
impl Eq for Expr
impl StructuralPartialEq for Expr
Auto Trait Implementations§
impl Freeze for Expr
impl RefUnwindSafe for Expr
impl Send for Expr
impl Sync for Expr
impl Unpin for Expr
impl UnwindSafe for Expr
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.