Enum syntax::ast::Pat_ [−] [src]

pub enum Pat_ {
    PatWild(PatWildKind),
    PatIdent(BindingMode, SpannedIdent, Option<P<Pat>>),
    PatEnum(Path, Option<Vec<P<Pat>>>),
    PatQPath(QSelf, Path),
    PatStruct(Path, Vec<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),
}
Unstable

Variants

PatWild
Unstable

Represents a wildcard pattern (either _ or ..)

PatIdent
Unstable

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
Unstable

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

PatQPath
Unstable

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
Unstable

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

PatTup
Unstable

A tuple pattern (a, b)

PatBox
Unstable

A box pattern

PatRegion
Unstable

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

PatLit
Unstable

A literal

PatRange
Unstable

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

PatVec
Unstable

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

PatMac
Unstable

A macro pattern; pre-expansion

Trait Implementations

Derived Implementations

impl Debug for Pat_

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

impl Hash for Pat_

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

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

impl Decodable for Pat_

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

impl Encodable for Pat_

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

impl Eq for Pat_

impl PartialEq for Pat_

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

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

impl Clone for Pat_

fn clone(&self) -> Pat_

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