pub struct Definitions {
table: DefPathTable,
next_disambiguator: UnordMap<(LocalDefId, DefPathData), u32>,
}
Expand description
The definition table containing node definitions.
It holds the DefPathTable
for LocalDefId
s/DefPath
s.
It also stores mappings to convert LocalDefId
s to/from HirId
s.
Fields§
§table: DefPathTable
§next_disambiguator: UnordMap<(LocalDefId, DefPathData), u32>
Implementations§
Source§impl Definitions
impl Definitions
pub fn def_path_table(&self) -> &DefPathTable
Sourcepub fn def_index_count(&self) -> usize
pub fn def_index_count(&self) -> usize
Gets the number of definitions.
pub fn def_key(&self, id: LocalDefId) -> DefKey
pub fn def_path_hash(&self, id: LocalDefId) -> DefPathHash
Sourcepub fn def_path(&self, id: LocalDefId) -> DefPath
pub fn def_path(&self, id: LocalDefId) -> DefPath
Returns the path from the crate root to index
. The root
nodes are not included in the path (i.e., this will be an
empty vector for the crate root). For an inlined item, this
will be the path of the item in the external crate (but the
path will begin with the path to the external crate).
Sourcepub fn new(stable_crate_id: StableCrateId) -> Definitions
pub fn new(stable_crate_id: StableCrateId) -> Definitions
Adds a root definition (no parent) and a few other reserved definitions.
Sourcepub fn create_def(
&mut self,
parent: LocalDefId,
data: DefPathData,
) -> LocalDefId
pub fn create_def( &mut self, parent: LocalDefId, data: DefPathData, ) -> LocalDefId
Adds a definition with a parent definition.
Sourcepub fn local_def_path_hash_to_def_id(
&self,
hash: DefPathHash,
) -> Option<LocalDefId>
pub fn local_def_path_hash_to_def_id( &self, hash: DefPathHash, ) -> Option<LocalDefId>
Returns None
if the DefPathHash
does not correspond to a LocalDefId
in the current compilation session. This can legitimately happen if the
DefPathHash
is from a DefId
in an upstream crate or, during incr. comp.,
if the DefPathHash
is from a previous compilation session and
the def-path does not exist anymore.
pub fn def_path_hash_to_def_index_map(&self) -> &DefPathHashMap
pub fn num_definitions(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl DynSend for Definitions
impl DynSync for Definitions
impl Freeze for Definitions
impl RefUnwindSafe for Definitions
impl Send for Definitions
impl Sync for Definitions
impl Unpin for Definitions
impl UnwindSafe for Definitions
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
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: 104 bytes