Enum rustpython_ast::PatternKind
source · pub enum PatternKind<U = ()> {
MatchValue {
value: Box<Expr<U>>,
},
MatchSingleton {
value: Constant,
},
MatchSequence {
patterns: Vec<Pattern<U>>,
},
MatchMapping {
keys: Vec<Expr<U>>,
patterns: Vec<Pattern<U>>,
rest: Option<String>,
},
MatchClass {
cls: Box<Expr<U>>,
patterns: Vec<Pattern<U>>,
kwd_attrs: Vec<String>,
kwd_patterns: Vec<Pattern<U>>,
},
MatchStar {
name: Option<String>,
},
MatchAs {
pattern: Option<Box<Pattern<U>>>,
name: Option<String>,
},
MatchOr {
patterns: Vec<Pattern<U>>,
},
}
Variants§
Trait Implementations§
source§impl<U: Clone> Clone for PatternKind<U>
impl<U: Clone> Clone for PatternKind<U>
source§fn clone(&self) -> PatternKind<U>
fn clone(&self) -> PatternKind<U>
Returns a copy 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 moresource§impl<U: Debug> Debug for PatternKind<U>
impl<U: Debug> Debug for PatternKind<U>
source§impl<U: PartialEq> PartialEq<PatternKind<U>> for PatternKind<U>
impl<U: PartialEq> PartialEq<PatternKind<U>> for PatternKind<U>
source§fn eq(&self, other: &PatternKind<U>) -> bool
fn eq(&self, other: &PatternKind<U>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.