pub enum Expr {
Show 29 variants
Void,
Error,
IntLit {
lit: u64,
},
DecLit {
lit: f64,
},
StrLit {
lit: CString,
},
CharLit {
lit: i8,
},
BoolLit {
lit: bool,
},
Const(Const),
DeclRef {
id: DeclRefId,
},
Call {
callee: ExprId,
arguments: SmallVec<[ExprId; 2]>,
},
AddrOf {
expr: ExprId,
is_mut: bool,
},
Pointer {
expr: ExprId,
is_mut: bool,
},
FunctionTy {
param_tys: Vec<ExprId>,
ret_ty: ExprId,
},
Deref(ExprId),
Set {
lhs: ExprId,
rhs: ExprId,
},
Do {
scope: ImperScopeId,
},
If {
condition: ExprId,
then_scope: ImperScopeId,
else_scope: Option<ImperScopeId>,
},
While {
loop_id: LoopId,
condition: ExprId,
scope: ImperScopeId,
},
For {
loop_id: LoopId,
binding: DeclId,
lower_bound: ExprId,
upper_bound: ExprId,
scope: ImperScopeId,
},
Break(Option<LoopId>),
Continue(Option<LoopId>),
Switch {
scrutinee: ExprId,
cases: Vec<SwitchCase>,
},
Cast {
expr: ExprId,
ty: ExprId,
cast_id: CastId,
},
Ret {
expr: ExprId,
decl: Option<DeclId>,
},
Mod {
id: ModScopeId,
extern_library_path: Option<ExprId>,
},
Import {
path: ExprId,
},
Struct(StructId),
Enum(EnumId),
StructLit {
ty: ExprId,
fields: Vec<FieldAssignment>,
id: StructLitId,
},
}
Variants
Void
Error
IntLit
Fields
lit: u64
DecLit
Fields
lit: f64
StrLit
Fields
lit: CString
CharLit
Fields
lit: i8
BoolLit
Fields
lit: bool
Const(Const)
DeclRef
Fields
id: DeclRefId
Call
AddrOf
Pointer
Transforms type into pointer type
FunctionTy
Deref(ExprId)
Set
Do
Fields
scope: ImperScopeId
If
While
For
Break(Option<LoopId>)
Continue(Option<LoopId>)
Switch
Cast
Ret
Mod
Import
Fields
path: ExprId
Struct(StructId)
Enum(EnumId)
StructLit
Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more