Struct ra_ap_base_db::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.
Implementations
impl CrateGraph
[src]
impl CrateGraph
[src]pub fn add_crate_root(
&mut self,
file_id: FileId,
edition: Edition,
display_name: Option<CrateDisplayName>,
cfg_options: CfgOptions,
env: Env,
proc_macro: Vec<ProcMacro>
) -> CrateId
[src]
&mut self,
file_id: FileId,
edition: Edition,
display_name: Option<CrateDisplayName>,
cfg_options: CfgOptions,
env: Env,
proc_macro: Vec<ProcMacro>
) -> CrateId
pub fn add_dep(
&mut self,
from: CrateId,
name: CrateName,
to: CrateId
) -> Result<(), CyclicDependenciesError>
[src]
&mut self,
from: CrateId,
name: CrateName,
to: CrateId
) -> Result<(), CyclicDependenciesError>
pub fn is_empty(&self) -> bool
[src]
pub fn iter(&self) -> impl Iterator<Item = CrateId> + '_
[src]
pub fn transitive_deps(&self, of: CrateId) -> impl Iterator<Item = CrateId> + '_
[src]
pub fn transitive_deps(&self, of: CrateId) -> impl Iterator<Item = CrateId> + '_
[src]Returns an iterator over all transitive dependencies of the given crate, including the crate itself.
pub fn transitive_rev_deps(
&self,
of: CrateId
) -> impl Iterator<Item = CrateId> + '_
[src]
pub fn transitive_rev_deps(
&self,
of: CrateId
) -> impl Iterator<Item = CrateId> + '_
[src]Returns all transitive reverse dependencies of the given crate, including the crate itself.
pub fn crates_in_topological_order(&self) -> Vec<CrateId>
[src]
pub fn crates_in_topological_order(&self) -> Vec<CrateId>
[src]Returns all crates in the graph, sorted in topological order (ie. dependencies of a crate come before the crate itself).
pub fn crate_id_for_crate_root(&self, file_id: FileId) -> Option<CrateId>
[src]
pub fn extend(&mut self, other: CrateGraph) -> u32
[src]
pub fn extend(&mut self, other: CrateGraph) -> u32
[src]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.
pub fn patch_cfg_if(&mut self) -> bool
[src]
Trait Implementations
impl Clone for CrateGraph
[src]
impl Clone for CrateGraph
[src]fn clone(&self) -> CrateGraph
[src]
fn clone(&self) -> CrateGraph
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for CrateGraph
[src]
impl Debug for CrateGraph
[src]impl Default for CrateGraph
[src]
impl Default for CrateGraph
[src]fn default() -> CrateGraph
[src]
fn default() -> CrateGraph
[src]Returns the “default value” for a type. Read more
impl Index<CrateId> for CrateGraph
[src]
impl Index<CrateId> for CrateGraph
[src]impl PartialEq<CrateGraph> for CrateGraph
[src]
impl PartialEq<CrateGraph> for CrateGraph
[src]fn eq(&self, other: &CrateGraph) -> bool
[src]
fn eq(&self, other: &CrateGraph) -> bool
[src]This method tests for self
and other
values to be equal, and is used
by ==
. Read more
fn ne(&self, other: &CrateGraph) -> bool
[src]
fn ne(&self, other: &CrateGraph) -> bool
[src]This method tests for !=
.
impl Eq for CrateGraph
[src]
impl StructuralEq for CrateGraph
[src]
impl StructuralPartialEq for CrateGraph
[src]
Auto Trait Implementations
impl RefUnwindSafe for CrateGraph
impl Send for CrateGraph
impl Sync for CrateGraph
impl Unpin for CrateGraph
impl UnwindSafe for CrateGraph
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]pub fn equivalent(&self, key: &K) -> bool
[src]
pub fn equivalent(&self, key: &K) -> bool
[src]Compare self to key
and return true
if they are equal.
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more