pub enum MirPattern {
Wildcard,
Binding(String),
LitInt(i64),
LitFloat(f64),
LitBool(bool),
LitString(String),
Tuple(Vec<MirPattern>),
Struct {
name: String,
fields: Vec<(String, MirPattern)>,
},
Variant {
enum_name: String,
variant: String,
fields: Vec<MirPattern>,
},
}Expand description
A pattern at MIR level.
Variants§
Wildcard
Wildcard: matches anything, binds nothing.
Binding(String)
Binding: matches anything, binds the value to a name.
LitInt(i64)
Literal patterns
LitFloat(f64)
LitBool(bool)
LitString(String)
Tuple(Vec<MirPattern>)
Tuple destructuring
Struct
Struct destructuring
Variant
Enum variant pattern
Trait Implementations§
Source§impl Clone for MirPattern
impl Clone for MirPattern
Source§fn clone(&self) -> MirPattern
fn clone(&self) -> MirPattern
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MirPattern
impl RefUnwindSafe for MirPattern
impl Send for MirPattern
impl Sync for MirPattern
impl Unpin for MirPattern
impl UnsafeUnpin for MirPattern
impl UnwindSafe for MirPattern
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