Struct rustc_hir::Pat[][src]

pub struct Pat<'hir> {
    pub hir_id: HirId,
    pub kind: PatKind<'hir>,
    pub span: Span,
    pub default_binding_modes: bool,
}

Fields

hir_id: HirIdkind: PatKind<'hir>span: Spandefault_binding_modes: bool

Implementations

Walk the pattern in left-to-right order, short circuiting (with .all(..)) if false is returned.

Note that when visiting e.g. Tuple(ps), if visiting ps[0] returns false, then ps[1] will not be visited.

Walk the pattern in left-to-right order.

If it(pat) returns false, the children are not visited.

Walk the pattern in left-to-right order.

If you always want to recurse, prefer this method over walk.

Call f on every “binding” in a pattern, e.g., on a in match foo() { Some(a) => (), None => () }

Call f on every “binding” in a pattern, e.g., on a in match foo() { Some(a) => (), None => () }.

When encountering an or-pattern p_0 | ... | p_n only p_0 will be visited.

Returns variants that are necessary to exist for the pattern to match.

Checks if the pattern contains any ref or ref mut bindings, and if yes whether it contains mutable or just immutables ones.

Trait Implementations

Formats the value using the given formatter. Read more

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

Performs the conversion.

Performs the conversion.

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.

Layout

Note: Most layout information is completely unstable and may be different between compiler versions and platforms. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.

Size: 88 bytes