Struct rustc_hir::definitions::DefPathTable
source · pub struct DefPathTable {
index_to_key: IndexVec<DefIndex, DefKey>,
def_path_hashes: IndexVec<DefIndex, DefPathHash>,
def_path_hash_to_index: DefPathHashMap,
}
Expand description
The DefPathTable
maps DefIndex
es to DefKey
s and vice versa.
Internally the DefPathTable
holds a tree of DefKey
s, where each DefKey
stores the DefIndex
of its parent.
There is one DefPathTable
for each crate.
Fields§
§index_to_key: IndexVec<DefIndex, DefKey>
§def_path_hashes: IndexVec<DefIndex, DefPathHash>
§def_path_hash_to_index: DefPathHashMap
Implementations§
source§impl DefPathTable
impl DefPathTable
fn allocate(&mut self, key: DefKey, def_path_hash: DefPathHash) -> DefIndex
pub fn def_key(&self, index: DefIndex) -> DefKey
pub fn def_path_hash(&self, index: DefIndex) -> DefPathHash
pub fn enumerated_keys_and_path_hashes( &self ) -> impl Iterator<Item = (DefIndex, &DefKey, &DefPathHash)> + ExactSizeIterator + '_
Trait Implementations§
source§impl Clone for DefPathTable
impl Clone for DefPathTable
source§fn clone(&self) -> DefPathTable
fn clone(&self) -> DefPathTable
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for DefPathTable
impl Debug for DefPathTable
source§impl Default for DefPathTable
impl Default for DefPathTable
source§fn default() -> DefPathTable
fn default() -> DefPathTable
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for DefPathTable
impl Send for DefPathTable
impl Sync for DefPathTable
impl Unpin for DefPathTable
impl UnwindSafe for DefPathTable
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 64 bytes