pub struct ExprIfLet {
pub attrs: Vec<Attribute>,
pub if_token: If,
pub let_token: Let,
pub pat: Box<Pat>,
pub eq_token: Eq,
pub expr: Box<Expr>,
pub then_branch: Block,
pub else_branch: Option<(Else, Box<Expr>)>,
}
Expand description
An if let
expression with an optional else
block: if let pat = expr { ... } else { ... }
.
The else
branch expression may only be an If
, IfLet
, or
Block
expression, not any of the other types of expression.
This type is available if Syn is built with the "full"
feature.
Fields§
§attrs: Vec<Attribute>
§if_token: If
§let_token: Let
§pat: Box<Pat>
§eq_token: Eq
§expr: Box<Expr>
§then_branch: Block
§else_branch: Option<(Else, Box<Expr>)>
Trait Implementations§
impl Eq for ExprIfLet
impl StructuralPartialEq for ExprIfLet
Auto Trait Implementations§
impl Freeze for ExprIfLet
impl RefUnwindSafe for ExprIfLet
impl !Send for ExprIfLet
impl !Sync for ExprIfLet
impl Unpin for ExprIfLet
impl UnwindSafe for ExprIfLet
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Spanned for Twhere
T: ToTokens,
impl<T> Spanned for Twhere
T: ToTokens,
Source§fn span(&self) -> Span
fn span(&self) -> Span
Returns a
Span
covering the complete contents of this syntax tree
node, or Span::call_site()
if this node is empty.