pub enum PatKind {
Wild,
Name(Ident),
Int {
negative: bool,
value: u64,
},
Str(String),
Bool(bool),
Path(Path),
Tuple {
path: Path,
items: Vec<Pat>,
},
Struct {
path: Path,
fields: Vec<FieldPat>,
rest: bool,
},
Or(Vec<Pat>),
Error,
}Expand description
The forms of patterns (spec chapter 3, section 7).
Variants§
Wild
_
Name(Ident)
A lone name: a binding, or a payload-less variant or constant (decided later).
Int
An integer, possibly negative.
Str(String)
A string.
Bool(bool)
true or false.
Path(Path)
A dotted path without payload: StorageError.Full.
Tuple
Some(x), Shape.Circle(r).
Struct
Point { x, y: 0, .. }.
Fields
Or(Vec<Pat>)
A | B
Error
A pattern that could not be parsed.
Trait Implementations§
impl StructuralPartialEq for PatKind
Auto Trait Implementations§
impl Freeze for PatKind
impl RefUnwindSafe for PatKind
impl Send for PatKind
impl Sync for PatKind
impl Unpin for PatKind
impl UnsafeUnpin for PatKind
impl UnwindSafe for PatKind
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