[][src]Struct ra_ap_project_model::CargoWorkspace

pub struct CargoWorkspace { /* fields omitted */ }

CargoWorkspace represents the logical structure of, well, a Cargo workspace. It pretty closely mirrors cargo metadata output.

Note that internally, rust analyzer uses a different structure: CrateGraph. CrateGraph is lower-level: it knows only about the crates, while this knows about Packages & Targets: purely cargo-related concepts.

We use absolute paths here, cargo metadata guarantees to always produce abs paths.

Implementations

impl CargoWorkspace[src]

pub fn from_cargo_metadata(
    cargo_toml: &AbsPath,
    cargo_features: &CargoConfig
) -> Result<CargoWorkspace>
[src]

pub fn packages<'a>(
    &'a self
) -> impl Iterator<Item = Package> + ExactSizeIterator + 'a
[src]

pub fn target_by_root(&self, root: &AbsPath) -> Option<Target>[src]

pub fn workspace_root(&self) -> &AbsPath[src]

pub fn package_flag(&self, package: &PackageData) -> String[src]

Trait Implementations

impl Clone for CargoWorkspace[src]

impl Debug for CargoWorkspace[src]

impl Eq for CargoWorkspace[src]

impl Index<Idx<PackageData>> for CargoWorkspace[src]

type Output = PackageData

The returned type after indexing.

impl Index<Idx<TargetData>> for CargoWorkspace[src]

type Output = TargetData

The returned type after indexing.

impl PartialEq<CargoWorkspace> for CargoWorkspace[src]

impl StructuralEq for CargoWorkspace[src]

impl StructuralPartialEq for CargoWorkspace[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.