pub enum Pattern {
Wildcard,
Var(Arc<str>),
Lit(Literal),
Record(Vec<(Arc<str>, Self)>),
List(Vec<Self>),
Constructor(Arc<str>, Vec<Self>),
}Expand description
A destructuring pattern for match expressions.
Variants§
Wildcard
Matches anything, binds nothing.
Var(Arc<str>)
Matches anything, binds the value to a name.
Lit(Literal)
Matches a specific literal value.
Record(Vec<(Arc<str>, Self)>)
Matches a record with specific field patterns.
List(Vec<Self>)
Matches a list with element patterns.
Constructor(Arc<str>, Vec<Self>)
Matches a tagged constructor with argument patterns.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Pattern
impl<'de> Deserialize<'de> for Pattern
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Pattern
impl StructuralPartialEq for Pattern
Auto Trait Implementations§
impl Freeze for Pattern
impl RefUnwindSafe for Pattern
impl Send for Pattern
impl Sync for Pattern
impl Unpin for Pattern
impl UnsafeUnpin for Pattern
impl UnwindSafe for Pattern
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