Trait rustc_middle::middle::cstore::CrateStore[−][src]

pub trait CrateStore {
    fn as_any(&self) -> &dyn Any;
fn def_key(&self, def: DefId) -> DefKey;
fn def_kind(&self, def: DefId) -> DefKind;
fn def_path(&self, def: DefId) -> DefPath;
fn def_path_hash(&self, def: DefId) -> DefPathHash;
fn def_path_hash_to_def_id(
        &self,
        cnum: CrateNum,
        index_guess: u32,
        hash: DefPathHash
    ) -> Option<DefId>;
fn crate_name_untracked(&self, cnum: CrateNum) -> Symbol;
fn crate_is_private_dep_untracked(&self, cnum: CrateNum) -> bool;
fn crate_disambiguator_untracked(
        &self,
        cnum: CrateNum
    ) -> CrateDisambiguator;
fn crate_hash_untracked(&self, cnum: CrateNum) -> Svh;
fn crates_untracked(&self) -> Vec<CrateNum>;
fn encode_metadata(&self, tcx: TyCtxt<'_>) -> EncodedMetadata;
fn metadata_encoding_version(&self) -> &[u8];
fn allocator_kind(&self) -> Option<AllocatorKind>; }

A store of Rust crates, through which their metadata can be accessed.

Note that this trait should probably not be expanding today. All new functionality should be driven through queries instead!

If you find a method on this trait named {name}_untracked it signifies that it’s not tracked for dependency information throughout compilation (it’d break incremental compilation) and should only be called pre-HIR (e.g. during resolve)

Required methods

fn as_any(&self) -> &dyn Any[src]

fn def_key(&self, def: DefId) -> DefKey[src]

fn def_kind(&self, def: DefId) -> DefKind[src]

fn def_path(&self, def: DefId) -> DefPath[src]

fn def_path_hash(&self, def: DefId) -> DefPathHash[src]

fn def_path_hash_to_def_id(
    &self,
    cnum: CrateNum,
    index_guess: u32,
    hash: DefPathHash
) -> Option<DefId>
[src]

fn crate_name_untracked(&self, cnum: CrateNum) -> Symbol[src]

fn crate_is_private_dep_untracked(&self, cnum: CrateNum) -> bool[src]

fn crate_disambiguator_untracked(&self, cnum: CrateNum) -> CrateDisambiguator[src]

fn crate_hash_untracked(&self, cnum: CrateNum) -> Svh[src]

fn crates_untracked(&self) -> Vec<CrateNum>[src]

fn encode_metadata(&self, tcx: TyCtxt<'_>) -> EncodedMetadata[src]

fn metadata_encoding_version(&self) -> &[u8][src]

fn allocator_kind(&self) -> Option<AllocatorKind>[src]

Loading content...

Implementors

Loading content...