pub enum PureStmt {
Local {
pattern: PurePattern,
ty: Option<PureType>,
init: Option<PureExpr>,
},
Semi(PureExpr),
Expr(PureExpr),
Item(Box<PureItem>),
}Expand description
A statement.
Variants§
Local
Local variable: let x = 1;
Fields
§
pattern: PurePatternBinding pattern (LHS of let).
Semi(PureExpr)
Expression with semicolon.
Expr(PureExpr)
Expression without semicolon (tail expression).
Item(Box<PureItem>)
Item statement (function inside function, etc.).
Implementations§
Source§impl PureStmt
impl PureStmt
Sourcepub fn get_expr(&self) -> Option<&PureExpr>
pub fn get_expr(&self) -> Option<&PureExpr>
Get the expression contained in this statement.
Returns Some for Local (init expr), Semi, and Expr variants.
Returns None for Item or if Local has no initializer.
Sourcepub fn get_expr_mut(&mut self) -> Option<&mut PureExpr>
pub fn get_expr_mut(&mut self) -> Option<&mut PureExpr>
Get mutable expression contained in this statement.
Trait Implementations§
impl Eq for PureStmt
impl StructuralPartialEq for PureStmt
Auto Trait Implementations§
impl Freeze for PureStmt
impl RefUnwindSafe for PureStmt
impl Send for PureStmt
impl Sync for PureStmt
impl Unpin for PureStmt
impl UnsafeUnpin for PureStmt
impl UnwindSafe for PureStmt
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
Mutably borrows from an owned value. Read more