Struct rustc_metadata::cstore::crate_metadata [] [src]

pub struct crate_metadata {
    pub name: String,
    pub extern_crate: Cell<Option<ExternCrate>>,
    pub data: MetadataBlob,
    pub cnum_map: RefCell<cnum_map>,
    pub cnum: CrateNum,
    pub codemap_import_info: RefCell<Vec<ImportedFileMap>>,
    pub staged_api: bool,
    pub index: Index,
    pub xref_index: DenseIndex,
    pub key_map: FnvHashMap<DefKeyDefIndex>,
    pub explicitly_linked: Cell<bool>,
}
Unstable (rustc_private)

Fields

name: String
Unstable (rustc_private)
extern_crate: Cell<Option<ExternCrate>>
Unstable (rustc_private)

Information about the extern crate that caused this crate to be loaded. If this is None, then the crate was injected (e.g., by the allocator)

data: MetadataBlob
Unstable (rustc_private)
cnum_map: RefCell<cnum_map>
Unstable (rustc_private)
cnum: CrateNum
Unstable (rustc_private)
codemap_import_info: RefCell<Vec<ImportedFileMap>>
Unstable (rustc_private)
staged_api: bool
Unstable (rustc_private)
index: Index
Unstable (rustc_private)
xref_index: DenseIndex
Unstable (rustc_private)
key_map: FnvHashMap<DefKeyDefIndex>
Unstable (rustc_private)

For each public item in this crate, we encode a key. When the crate is loaded, we read all the keys and put them in this hashmap, which gives the reverse mapping. This allows us to quickly retrace a DefPath, which is needed for incremental compilation support.

explicitly_linked: Cell<bool>
Unstable (rustc_private)

Flag if this crate is required by an rlib version of this crate, or in other words whether it was explicitly linked to. An example of a crate where this is false is when an allocator crate is injected into the dependency list, and therefore isn't actually needed to link an rlib.

Methods

impl crate_metadata
[src]

fn data<'a>(&'a self) -> &'a [u8]

fn name(&self) -> &str

fn hash(&self) -> Svh

fn disambiguator(&self) -> &str

fn imported_filemaps<'a>(&'a self, codemap: &CodeMap) -> Ref<'a, Vec<ImportedFileMap>>

fn is_allocator(&self) -> bool

fn needs_allocator(&self) -> bool

fn is_panic_runtime(&self) -> bool

fn needs_panic_runtime(&self) -> bool

fn panic_strategy(&self) -> PanicStrategy