Enum syntex_syntax::ast::Pat_ [] [src]

pub enum Pat_ {
    PatWild,
    PatIdent(BindingModeSpannedIdentOption<P<Pat>>),
    PatEnum(PathOption<Vec<P<Pat>>>),
    PatQPath(QSelfPath),
    PatStruct(PathVec<Spanned<FieldPat>>, bool),
    PatTup(Vec<P<Pat>>),
    PatBox(P<Pat>),
    PatRegion(P<Pat>, Mutability),
    PatLit(P<Expr>),
    PatRange(P<Expr>, P<Expr>),
    PatVec(Vec<P<Pat>>, Option<P<Pat>>, Vec<P<Pat>>),
    PatMac(Mac),
}

Variants

PatWild

Represents a wildcard pattern (_)

PatIdent(BindingModeSpannedIdentOption<P<Pat>>)

A PatIdent may either be a new bound variable, or a nullary enum (in which case the third field is None).

In the nullary enum case, the parser can't determine which it is. The resolver determines this, and records this pattern's NodeId in an auxiliary set (of "PatIdents that refer to nullary enums")

PatEnum(PathOption<Vec<P<Pat>>>)

"None" means a Variant(..) pattern where we don't bind the fields to names.

PatQPath(QSelfPath)

An associated const named using the qualified path <T>::CONST or <T as Trait>::CONST. Associated consts from inherent impls can be referred to as simply T::CONST, in which case they will end up as PatEnum, and the resolver will have to sort that out.

PatStruct(PathVec<Spanned<FieldPat>>, bool)

Destructuring of a struct, e.g. Foo {x, y, ..} The bool is true in the presence of a ..

PatTup(Vec<P<Pat>>)

A tuple pattern (a, b)

PatBox(P<Pat>)

A box pattern

PatRegion(P<Pat>, Mutability)

A reference pattern, e.g. &mut (a, b)

PatLit(P<Expr>)

A literal

PatRange(P<Expr>, P<Expr>)

A range pattern, e.g. 1...2

PatVec(Vec<P<Pat>>, Option<P<Pat>>, Vec<P<Pat>>)

[a, b, ..i, y, z] is represented as: PatVec(box [a, b], Some(i), box [y, z])

PatMac(Mac)

A macro pattern; pre-expansion

Trait Implementations

impl Debug for Pat_
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Hash for Pat_
[src]

fn hash<__H: Hasher>(&self, __arg_0: &mut __H)

Feeds this value into the state given, updating the hasher as necessary.

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0

Feeds a slice of this type into the state provided.

impl Decodable for Pat_
[src]

fn decode<__D: Decoder>(__arg_0: &mut __D) -> Result<Pat_, __D::Error>

impl Encodable for Pat_
[src]

fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>

impl Eq for Pat_
[src]

impl PartialEq for Pat_
[src]

fn eq(&self, __arg_0: &Pat_) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &Pat_) -> bool

This method tests for !=.

impl Clone for Pat_
[src]

fn clone(&self) -> Pat_

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more