Struct ra_ap_project_model::CargoWorkspace
source · [−]pub struct CargoWorkspace { /* private fields */ }
Expand description
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
sourceimpl CargoWorkspace
impl CargoWorkspace
pub fn fetch_metadata(
cargo_toml: &ManifestPath,
current_dir: &AbsPath,
config: &CargoConfig,
progress: &dyn Fn(String)
) -> Result<Metadata>
pub fn new(meta: Metadata) -> CargoWorkspace
pub fn packages<'a>(
&'a self
) -> impl Iterator<Item = Package> + ExactSizeIterator + 'a
pub fn target_by_root(&self, root: &AbsPath) -> Option<Target>
pub fn workspace_root(&self) -> &AbsPath
pub fn package_flag(&self, package: &PackageData) -> String
pub fn parent_manifests(
&self,
manifest_path: &ManifestPath
) -> Option<Vec<ManifestPath>>
Trait Implementations
sourceimpl Clone for CargoWorkspace
impl Clone for CargoWorkspace
sourcefn clone(&self) -> CargoWorkspace
fn clone(&self) -> CargoWorkspace
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for CargoWorkspace
impl Debug for CargoWorkspace
sourceimpl Index<Idx<PackageData>> for CargoWorkspace
impl Index<Idx<PackageData>> for CargoWorkspace
type Output = PackageData
type Output = PackageData
The returned type after indexing.
sourcefn index(&self, index: Package) -> &PackageData
fn index(&self, index: Package) -> &PackageData
Performs the indexing (container[index]
) operation. Read more
sourceimpl Index<Idx<TargetData>> for CargoWorkspace
impl Index<Idx<TargetData>> for CargoWorkspace
type Output = TargetData
type Output = TargetData
The returned type after indexing.
sourcefn index(&self, index: Target) -> &TargetData
fn index(&self, index: Target) -> &TargetData
Performs the indexing (container[index]
) operation. Read more
sourceimpl PartialEq<CargoWorkspace> for CargoWorkspace
impl PartialEq<CargoWorkspace> for CargoWorkspace
sourcefn eq(&self, other: &CargoWorkspace) -> bool
fn eq(&self, other: &CargoWorkspace) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &CargoWorkspace) -> bool
fn ne(&self, other: &CargoWorkspace) -> bool
This method tests for !=
.
impl Eq for CargoWorkspace
impl StructuralEq for CargoWorkspace
impl StructuralPartialEq for CargoWorkspace
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more