Struct rustc_typeck::hir::Crate [] [src]

pub struct Crate {
    pub module: Mod,
    pub attrs: P<[Spanned<Attribute_>]>,
    pub config: P<[P<Spanned<MetaItemKind>>]>,
    pub span: Span,
    pub exported_macros: P<[MacroDef]>,
    pub items: BTreeMap<u32Item>,
}
Unstable (rustc_private)

Fields

module: Mod
Unstable (rustc_private)
attrs: P<[Spanned<Attribute_>]>
Unstable (rustc_private)
config: P<[P<Spanned<MetaItemKind>>]>
Unstable (rustc_private)
span: Span
Unstable (rustc_private)
exported_macros: P<[MacroDef]>
Unstable (rustc_private)
items: BTreeMap<u32Item>
Unstable (rustc_private)

Methods

impl Crate

fn item(&self, id: u32) -> &Item

fn visit_all_items<'hir, V>(&'hir self, visitor: &mut V) where V: Visitor<'hir>

Unstable (rustc_private)

Visits all items in the crate in some determinstic (but unspecified) order. If you just need to process every item, but don't care about nesting, this method is the best choice.

If you do care about nesting -- usually because your algorithm follows lexical scoping rules -- then you want a different approach. You should override visit_nested_item in your visitor and then call intravisit::walk_crate instead.

Trait Implementations

Derived Implementations

impl Debug for Crate

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

Formats the value using the given formatter.

impl Decodable for Crate

fn decode<__D>(__arg_0: &mut __D) -> Result<Crate, __D::Error> where __D: Decoder

impl Encodable for Crate

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

impl Eq for Crate

impl PartialEq<Crate> for Crate

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

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

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

This method tests for !=.

impl Clone for Crate

fn clone(&self) -> Crate

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