pub struct Definitions {
    table: DefPathTable,
    next_disambiguator: FxHashMap<(LocalDefId, DefPathData), u32>,
    expansions_that_defined: FxHashMap<LocalDefId, ExpnId>,
    def_id_to_span: IndexVec<LocalDefId, Span>,
    stable_crate_id: StableCrateId,
Expand description

The definition table containing node definitions. It holds the DefPathTable for LocalDefIds/DefPaths. It also stores mappings to convert LocalDefIds to/from HirIds.


table: DefPathTablenext_disambiguator: FxHashMap<(LocalDefId, DefPathData), u32>expansions_that_defined: FxHashMap<LocalDefId, ExpnId>

Item with a given LocalDefId was defined during macro expansion with ID ExpnId.

def_id_to_span: IndexVec<LocalDefId, Span>stable_crate_id: StableCrateId

The StableCrateId of the local crate.


Gets the number of definitions.

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).

Adds a root definition (no parent) and a few other reserved definitions.

Adds a definition with a parent definition.

Retrieves the span of the given DefId if DefId is in the local crate.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.


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: 160 bytes