#[non_exhaustive]pub enum Pat {
Var {
name: Identifier,
pos: Pos,
span: Span,
},
Wild {
pos: Pos,
span: Span,
},
Con {
qualifier: Option<ModuleName>,
name: Identifier,
args: Vec<Self>,
pos: Pos,
span: Span,
},
Tuple {
items: Vec<Self>,
pos: Pos,
span: Span,
},
List {
items: Vec<Self>,
pos: Pos,
span: Span,
},
Lit {
kind: LitKind,
text: String,
pos: Pos,
span: Span,
},
As {
name: Identifier,
pat: Box<Self>,
pos: Pos,
span: Span,
},
Other {
raw: String,
pos: Pos,
span: Span,
},
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Var
Wild
Con
Tuple
List
Lit
As
name@pat
Other
Anything the parser couldn’t classify; raw text preserved.
Implementations§
Trait Implementations§
impl Eq for Pat
impl StructuralPartialEq for Pat
Auto Trait Implementations§
impl Freeze for Pat
impl RefUnwindSafe for Pat
impl Send for Pat
impl Sync for Pat
impl Unpin for Pat
impl UnsafeUnpin for Pat
impl UnwindSafe for Pat
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