Struct ide::CrateGraph[][src]

pub struct CrateGraph { /* fields omitted */ }
Expand description

CrateGraph is a bit of information which turns a set of text files into a number of Rust crates.

Each crate is defined by the FileId of its root module, the set of enabled cfg flags and the set of dependencies.

Note that, due to cfg’s, there might be several crates for a single FileId!

For the purposes of analysis, a crate does not have a name. Instead, names are specified on dependency edges. That is, a crate might be known under different names in different dependent crates.

Note that CrateGraph is build-system agnostic: it’s a concept of the Rust language proper, not a concept of the build system. In practice, we get CrateGraph by lowering cargo metadata output.

CrateGraph is !Serialize by design, see https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/dev/architecture.md#serialization

Implementations

Returns an iterator over all transitive dependencies of the given crate, including the crate itself.

Returns all transitive reverse dependencies of the given crate, including the crate itself.

Returns all crates in the graph, sorted in topological order (ie. dependencies of a crate come before the crate itself).

Extends this crate graph by adding a complete disjoint second crate graph.

The ids of the crates in the other graph are shifted by the return amount.

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

Returns the “default value” for a type. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. 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

Cast a value to type U using CastTo.

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

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)

recently added

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more