pub enum ExprKind {
Lit(Lit),
Var(String),
Call(CExpr),
Sizeof(Type),
Unary {
op: UnaryOp,
operand: Box<Expr>,
},
Binary {
op: BinaryOp,
lhs: Box<Expr>,
rhs: Box<Expr>,
},
Field {
expr: Box<Expr>,
field: String,
},
Cast {
expr: Box<Expr>,
ty: Type,
},
}Expand description
The variant and payload of an Expr.
Variants§
Lit(Lit)
A literal value.
Var(String)
A variable reference: x.
Call(CExpr)
A function call: alias.fn_name(args).
Sizeof(Type)
sizeof(T) — byte size of type T.
Unary
Unary operation: -e, !e, ~e.
Binary
Binary operation: lhs op rhs.
Field
Field access: expr.field.
Cast
An explicit conversion: expr as T. Tighter than every binary
operator, looser than unary: -x as uint is (-x) as uint,
a + x as uint is a + (x as uint).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ExprKind
impl RefUnwindSafe for ExprKind
impl Send for ExprKind
impl Sync for ExprKind
impl Unpin for ExprKind
impl UnsafeUnpin for ExprKind
impl UnwindSafe for ExprKind
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.