Struct rustc_typeck::hir::Crate
[−]
[src]
pub struct Crate { pub module: Mod, pub attrs: P<[Attribute]>, pub span: Span, pub exported_macros: P<[MacroDef]>, pub items: BTreeMap<NodeId, Item>, pub trait_items: BTreeMap<TraitItemId, TraitItem>, pub impl_items: BTreeMap<ImplItemId, ImplItem>, pub bodies: BTreeMap<BodyId, Body>, pub trait_impls: BTreeMap<DefId, Vec<NodeId>>, pub trait_default_impl: BTreeMap<DefId, NodeId>, pub body_ids: Vec<BodyId>, }
rustc_private
)Fields
module: Mod
rustc_private
)attrs: P<[Attribute]>
rustc_private
)span: Span
rustc_private
)exported_macros: P<[MacroDef]>
rustc_private
)items: BTreeMap<NodeId, Item>
rustc_private
)trait_items: BTreeMap<TraitItemId, TraitItem>
rustc_private
)impl_items: BTreeMap<ImplItemId, ImplItem>
rustc_private
)bodies: BTreeMap<BodyId, Body>
rustc_private
)trait_impls: BTreeMap<DefId, Vec<NodeId>>
rustc_private
)trait_default_impl: BTreeMap<DefId, NodeId>
rustc_private
)body_ids: Vec<BodyId>
rustc_private
)A list of the body ids written out in the order in which they appear in the crate. If you're going to process all the bodies in the crate, you should iterate over this list rather than the keys of bodies.
Methods
impl Crate
[src]
fn item(&self, id: NodeId) -> &Item
rustc_private
)fn trait_item(&self, id: TraitItemId) -> &TraitItem
rustc_private
)fn impl_item(&self, id: ImplItemId) -> &ImplItem
rustc_private
)fn visit_all_item_likes<'hir, V>(&'hir self, visitor: &mut V) where V: ItemLikeVisitor<'hir>
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.
fn body(&self, id: BodyId) -> &Body
rustc_private
)Trait Implementations
impl Decodable for Crate
[src]
fn decode<__D>(__arg_0: &mut __D) -> Result<Crate, __D::Error> where __D: Decoder
rustc_private
)impl PartialEq<Crate> 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 PpAnn for Crate
[src]
fn nested(&self, state: &mut State, nested: Nested) -> Result<(), Error>
rustc_private
)fn pre(&self, _state: &mut State, _node: AnnNode) -> Result<(), Error>
rustc_private
)fn post(&self, _state: &mut State, _node: AnnNode) -> Result<(), Error>
rustc_private
)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
impl Eq for Crate
[src]
impl Debug for Crate
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter.