Struct rustc::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<Name>)
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<Name>
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 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
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 Eq for Pat[src]
impl Encodable for Pat[src]
fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>
🔬 This is a nightly-only experimental API. (rustc_private)
deprecated in favor of rustc-serialize on crates.io
impl Decodable for Pat[src]
fn decode<__D: Decoder>(__arg_0: &mut __D) -> Result<Pat, __D::Error>
🔬 This is a nightly-only experimental API. (rustc_private)
deprecated in favor of rustc-serialize on crates.io
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: Hasher1.3.0
Feeds a slice of this type into the state provided.