Struct guppy::graph::Workspace [−][src]
pub struct Workspace<'g> { /* fields omitted */ }
Expand description
Information about a workspace, parsed from metadata returned by cargo metadata
.
For more about workspaces, see Cargo Workspaces in The Rust Programming Language.
Implementations
Returns the number of packages in this workspace.
Returns true if the workspace contains a package by the given name.
Returns true if the workspace contains a package by the given workspace path.
Returns an iterator over package metadatas, sorted by the path they’re in.
pub fn iter_by_path(
&self
) -> impl Iterator<Item = (&'g Utf8Path, PackageMetadata<'g>)> + ExactSizeIterator
pub fn iter_by_path(
&self
) -> impl Iterator<Item = (&'g Utf8Path, PackageMetadata<'g>)> + ExactSizeIterator
Returns an iterator over workspace paths and package metadatas, sorted by the path they’re in.
pub fn iter_by_name(
&self
) -> impl Iterator<Item = (&'g str, PackageMetadata<'g>)> + ExactSizeIterator
pub fn iter_by_name(
&self
) -> impl Iterator<Item = (&'g str, PackageMetadata<'g>)> + ExactSizeIterator
Returns an iterator over workspace names and package metadatas, sorted by names.
Returns an iterator over package IDs for workspace members. The package IDs will be returned
in the same order as members
, sorted by the path they’re in.
pub fn member_by_path(
&self,
path: impl AsRef<Utf8Path>
) -> Result<PackageMetadata<'g>, Error>
pub fn member_by_path(
&self,
path: impl AsRef<Utf8Path>
) -> Result<PackageMetadata<'g>, Error>
Maps the given path to the corresponding workspace member.
Returns an error if the path didn’t match any workspace members.
pub fn members_by_paths<B>(
&self,
paths: impl IntoIterator<Item = impl AsRef<Utf8Path>>
) -> Result<B, Error> where
B: FromIterator<PackageMetadata<'g>>,
pub fn members_by_paths<B>(
&self,
paths: impl IntoIterator<Item = impl AsRef<Utf8Path>>
) -> Result<B, Error> where
B: FromIterator<PackageMetadata<'g>>,
Maps the given paths to their corresponding workspace members, returning a new value of
the specified collection type (e.g. Vec
).
Returns an error if any of the paths were unknown.
Maps the given name to the corresponding workspace member.
Returns an error if the name didn’t match any workspace members.
pub fn members_by_names<B>(
&self,
names: impl IntoIterator<Item = impl AsRef<str>>
) -> Result<B, Error> where
B: FromIterator<PackageMetadata<'g>>,
pub fn members_by_names<B>(
&self,
names: impl IntoIterator<Item = impl AsRef<str>>
) -> Result<B, Error> where
B: FromIterator<PackageMetadata<'g>>,
Maps the given names to their corresponding workspace members, returning a new value of
the specified collection type (e.g. Vec
).
Returns an error if any of the paths were unknown.
Trait Implementations
Auto Trait Implementations
impl<'g> RefUnwindSafe for Workspace<'g>
impl<'g> UnwindSafe for Workspace<'g>
Blanket Implementations
Mutably borrows from an owned value. Read more