Struct rustc_typeck::hir::Pat
[−]
[src]
pub struct Pat {
pub id: NodeId,
pub node: PatKind,
pub span: Span,
}rustc_private)Fields
id: NodeId
rustc_private)node: PatKind
rustc_private)span: Span
rustc_private)Methods
impl Pat[src]
fn is_refutable(&self) -> bool
rustc_private)fn is_const(&self) -> bool
rustc_private)fn each_binding<F>(&self, f: F) where F: FnMut(BindingMode, NodeId, Span, &Spanned<Symbol>) -> ()
rustc_private)Call f on every "binding" in a pattern, e.g., on a in
match foo() { Some(a) => (), None => () }
fn contains_bindings(&self) -> bool
rustc_private)Checks if the pattern contains any patterns that bind something to
an ident, e.g. foo, or Foo(foo) or foo @ Bar(..).
fn contains_bindings_or_wild(&self) -> bool
rustc_private)Checks if the pattern contains any patterns that bind something to
an ident or wildcard, e.g. foo, or Foo(_), foo @ Bar(..),
fn simple_name(&self) -> Option<Symbol>
rustc_private)fn necessary_variants(&self) -> Vec<DefId>
rustc_private)Return variants that are necessary to exist for the pattern to match.
fn contains_ref_binding(&self) -> Option<Mutability>
rustc_private)Checks if the pattern contains any ref or ref mut bindings,
and if yes whether its containing mutable ones or just immutables ones.
impl Pat[src]
fn walk<F>(&self, it: F) -> bool where F: FnMut(&Pat) -> bool
rustc_private)Trait Implementations
impl Decodable for Pat[src]
fn decode<__D>(__arg_0: &mut __D) -> Result<Pat, __D::Error> where __D: Decoder
rustc_private)impl PartialEq<Pat> 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 Hash for Pat[src]
fn hash<__H>(&self, __arg_0: &mut __H) where __H: Hasher
Feeds this value into the state given, updating the hasher as necessary.
fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher1.3.0
Feeds a slice of this type into the state provided.
impl ast_node for Pat[src]
fn id(&self) -> NodeId
rustc_private)fn span(&self) -> Span
rustc_private)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