[−][src]Struct ra_ap_project_model::CargoWorkspace
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]
cargo_toml: &AbsPath,
cargo_features: &CargoConfig
) -> Result<CargoWorkspace>
pub fn packages<'a>(
&'a self
) -> impl Iterator<Item = Package> + ExactSizeIterator + 'a
[src]
&'a self
) -> impl Iterator<Item = Package> + ExactSizeIterator + 'a
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]
fn clone(&self) -> CargoWorkspace
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[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.
fn index(&self, index: Package) -> &PackageData
[src]
impl Index<Idx<TargetData>> for CargoWorkspace
[src]
type Output = TargetData
The returned type after indexing.
fn index(&self, index: Target) -> &TargetData
[src]
impl PartialEq<CargoWorkspace> for CargoWorkspace
[src]
fn eq(&self, other: &CargoWorkspace) -> bool
[src]
fn ne(&self, other: &CargoWorkspace) -> bool
[src]
impl StructuralEq for CargoWorkspace
[src]
impl StructuralPartialEq for CargoWorkspace
[src]
Auto Trait Implementations
impl RefUnwindSafe for CargoWorkspace
impl Send for CargoWorkspace
impl Sync for CargoWorkspace
impl Unpin for CargoWorkspace
impl UnwindSafe for CargoWorkspace
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,
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,
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.
fn to_owned(&self) -> T
[src]
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.
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>,