[−][src]Struct ra_ap_base_db::CrateGraph
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 cfg flags (not yet implemented) and the set of dependencies. Note
that, due to cfg's, there might be several crates for a single FileId
! As
in the rust-lang proper, 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]
pub fn add_crate_root(
&mut self,
file_id: FileId,
edition: Edition,
display_name: Option<CrateDisplayName>,
cfg_options: CfgOptions,
env: Env,
proc_macro: Vec<(SmolStr, Arc<dyn TokenExpander>)>
) -> CrateId
[src]
&mut self,
file_id: FileId,
edition: Edition,
display_name: Option<CrateDisplayName>,
cfg_options: CfgOptions,
env: Env,
proc_macro: Vec<(SmolStr, Arc<dyn TokenExpander>)>
) -> 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]
Returns an iterator over all transitive dependencies of the given crate.
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]
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]
fn clone(&self) -> CrateGraph
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for CrateGraph
[src]
impl Default for CrateGraph
[src]
fn default() -> CrateGraph
[src]
impl Eq for CrateGraph
[src]
impl Index<CrateId> for CrateGraph
[src]
type Output = CrateData
The returned type after indexing.
fn index(&self, crate_id: CrateId) -> &CrateData
[src]
impl PartialEq<CrateGraph> for CrateGraph
[src]
fn eq(&self, other: &CrateGraph) -> bool
[src]
fn ne(&self, other: &CrateGraph) -> bool
[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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,