Struct rustc::hir::Crate [] [src]

pub struct Crate {
    pub module: Mod,
    pub attrs: HirVec<Attribute>,
    pub config: CrateConfig,
    pub span: Span,
    pub exported_macros: HirVec<MacroDef>,
    pub items: BTreeMap<NodeIdItem>,
}
Unstable (rustc_private)

Fields

module: Mod
Unstable (rustc_private)
attrs: HirVec<Attribute>
Unstable (rustc_private)
config: CrateConfig
Unstable (rustc_private)
span: Span
Unstable (rustc_private)
exported_macros: HirVec<MacroDef>
Unstable (rustc_private)
items: BTreeMap<NodeIdItem>
Unstable (rustc_private)

Methods

impl Crate
[src]

fn item(&self, id: NodeId) -> &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
[src]

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

Formats the value using the given formatter.

impl Decodable for Crate
[src]

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

impl Encodable for Crate
[src]

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

impl Eq for Crate
[src]

impl PartialEq for Crate
[src]

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
[src]

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