Enum hir_def::expr::Pat[][src]

pub enum Pat {
Show 14 variants Missing, Wild, Tuple { args: Vec<PatId>, ellipsis: Option<usize>, }, Or(Vec<PatId>), Record { path: Option<Box<Path>>, args: Vec<RecordFieldPat>, ellipsis: bool, }, Range { start: ExprId, end: ExprId, }, Slice { prefix: Vec<PatId>, slice: Option<PatId>, suffix: Vec<PatId>, }, Path(Box<Path>), Lit(ExprId), Bind { mode: BindingAnnotation, name: Name, subpat: Option<PatId>, }, TupleStruct { path: Option<Box<Path>>, args: Vec<PatId>, ellipsis: Option<usize>, }, Ref { pat: PatId, mutability: Mutability, }, Box { inner: PatId, }, ConstBlock(ExprId),
}
Expand description

Close relative to rustc’s hir::PatKind

Variants

Missing
Wild
Tuple

Fields of Tuple

args: Vec<PatId>ellipsis: Option<usize>
Or(Vec<PatId>)

Tuple Fields of Or

0: Vec<PatId>
Record

Fields of Record

path: Option<Box<Path>>args: Vec<RecordFieldPat>ellipsis: bool
Range

Fields of Range

start: ExprIdend: ExprId
Slice

Fields of Slice

prefix: Vec<PatId>slice: Option<PatId>suffix: Vec<PatId>
Path(Box<Path>)

Tuple Fields of Path

0: Box<Path>
Lit(ExprId)

Tuple Fields of Lit

0: ExprId
Bind

Fields of Bind

mode: BindingAnnotationname: Namesubpat: Option<PatId>
TupleStruct

Fields of TupleStruct

path: Option<Box<Path>>args: Vec<PatId>ellipsis: Option<usize>
Ref

Fields of Ref

pat: PatIdmutability: Mutability
Box

Fields of Box

inner: PatId
ConstBlock(ExprId)

Tuple Fields of ConstBlock

0: ExprId

Implementations

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more