pub enum Pattern {
    WildCard,
    Rest,
    Literal(Node<LiteralPattern>),
    Tuple(Vec<Node<Pattern>>),
    Path(Node<Path>),
    PathTuple(Node<Path>, Vec<Node<Pattern>>),
    PathStruct {
        path: Node<Path>,
        fields: Vec<(Node<SmolStr>, Node<Pattern>)>,
        has_rest: bool,
    },
    Or(Vec<Node<Pattern>>),
}Variants§
WildCard
Represents a wildcard pattern _.
Rest
Rest pattern. e.g., ..
Literal(Node<LiteralPattern>)
Represents a literal pattern. e.g., true.
Tuple(Vec<Node<Pattern>>)
Represents tuple destructuring pattern. e.g., (x, y, z).
Path(Node<Path>)
Represents unit variant pattern. e.g., Enum::Unit.
PathTuple(Node<Path>, Vec<Node<Pattern>>)
Represents tuple variant pattern. e.g., Enum::Tuple(x, y, z).
PathStruct
Represents struct or struct variant destructuring pattern. e.g.,
MyStruct {x: pat1, y: pat2}}.
Or(Vec<Node<Pattern>>)
Represents or pattern. e.g., EnumUnit | EnumTuple(_, _, _)
Implementations§
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 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
Source§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
 
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
 
fn equivalent(&self, key: &K) -> bool
Compare self to 
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
 
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
 
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
 
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
 
fn equivalent(&self, key: &K) -> bool
Compare self to 
key and return true if they are equal.