[−]Struct ra_ap_ide::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
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 + 'static>), Global>
) -> CrateId
&mut self,
file_id: FileId,
edition: Edition,
display_name: Option<CrateDisplayName>,
cfg_options: CfgOptions,
env: Env,
proc_macro: Vec<(SmolStr, Arc<dyn TokenExpander + 'static>), Global>
) -> CrateId
pub fn add_dep(
&mut self,
from: CrateId,
name: CrateName,
to: CrateId
) -> Result<(), CyclicDependenciesError>
&mut self,
from: CrateId,
name: CrateName,
to: CrateId
) -> Result<(), CyclicDependenciesError>
pub fn is_empty(&self) -> bool
pub fn iter(&self) -> impl Iterator<Item = CrateId>
pub fn transitive_deps(&self, of: CrateId) -> impl Iterator<Item = CrateId>
Returns an iterator over all transitive dependencies of the given crate.
pub fn crates_in_topological_order(&self) -> Vec<CrateId, Global>
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>
pub fn extend(&mut self, other: CrateGraph) -> u32
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
Trait Implementations
impl Clone for CrateGraph
pub fn clone(&self) -> CrateGraph
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for CrateGraph
impl Default for CrateGraph
pub fn default() -> CrateGraph
impl Eq for CrateGraph
impl Index<CrateId> for CrateGraph
type Output = CrateData
The returned type after indexing.
pub fn index(&self, crate_id: CrateId) -> &CrateData
impl PartialEq<CrateGraph> for CrateGraph
pub fn eq(&self, other: &CrateGraph) -> bool
pub fn ne(&self, other: &CrateGraph) -> bool
impl StructuralEq for CrateGraph
impl StructuralPartialEq for CrateGraph
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> Any for T where
T: Any,
T: Any,
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<T> Cast for T
pub fn cast<U>(self, interner: &<U as HasInterner>::Interner) -> U where
Self: CastTo<U>,
U: HasInterner,
Self: CastTo<U>,
U: HasInterner,
impl<T> CloneAny for T where
T: Clone + Any,
T: Clone + Any,
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> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
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>,