Struct guppy::graph::Workspace[][src]

pub struct Workspace<'g> { /* fields omitted */ }

Information about a workspace, parsed from metadata returned by cargo metadata.

For more about workspaces, see Cargo Workspaces in The Rust Programming Language.

Implementations

impl<'g> Workspace<'g>[src]

These parallel iterators require the rayon1 feature is enabled.

pub fn par_iter(&self) -> impl ParallelIterator<Item = PackageMetadata<'g>>[src]

Returns a parallel iterator over package metadatas, sorted by workspace path.

Requires the rayon1 feature to be enabled.

pub fn par_iter_by_path(
    &self
) -> impl ParallelIterator<Item = (&'g Path, PackageMetadata<'g>)>
[src]

Returns a parallel iterator over workspace paths and package metadatas, sorted by workspace paths.

Requires the rayon1 feature to be enabled.

pub fn par_iter_by_name(
    &self
) -> impl ParallelIterator<Item = (&'g str, PackageMetadata<'g>)>
[src]

Returns a parallel iterator over workspace names and package metadatas, sorted by package names.

Requires the rayon1 feature to be enabled.

impl<'g> Workspace<'g>[src]

pub fn root(&self) -> &'g Path[src]

Returns the workspace root.

pub fn member_count(&self) -> usize[src]

Returns the number of packages in this workspace.

pub fn contains_name(&self, name: impl AsRef<str>) -> bool[src]

Returns true if the workspace contains a package by the given name.

pub fn contains_path(&self, path: impl AsRef<Path>) -> bool[src]

Returns true if the workspace contains a package by the given workspace path.

pub fn iter(
    &self
) -> impl Iterator<Item = PackageMetadata<'g>> + ExactSizeIterator
[src]

Returns an iterator over package metadatas, sorted by the path they're in.

pub fn iter_by_path(
    &self
) -> impl Iterator<Item = (&'g Path, PackageMetadata<'g>)> + ExactSizeIterator
[src]

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
[src]

Returns an iterator over workspace names and package metadatas, sorted by names.

pub fn member_ids(
    &self
) -> impl Iterator<Item = &'g PackageId> + ExactSizeIterator
[src]

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<Path>
) -> Result<PackageMetadata<'g>, Error>
[src]

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<Path>>
) -> Result<B, Error> where
    B: FromIterator<PackageMetadata<'g>>, 
[src]

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.

pub fn member_by_name(
    &self,
    name: impl AsRef<str>
) -> Result<PackageMetadata<'g>, Error>
[src]

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>>, 
[src]

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.

impl<'g> Workspace<'g>[src]

Helpers for property testing

The methods in this section allow a Workspace to be used in property-based testing scenarios.

Currently, proptest 0.10 is supported if the proptest010 feature is enabled.

pub fn prop010_name_strategy(&self) -> impl Strategy<Value = &'g str> + 'g[src]

Returns a Strategy that generates random package names from this workspace.

Requires the proptest010 feature to be enabled.

Panics

Panics if there are no packages in this Workspace.

pub fn prop010_id_strategy(&self) -> impl Strategy<Value = &'g PackageId> + 'g[src]

Returns a Strategy that generates random package IDs from this workspace.

Requires the proptest010 feature to be enabled.

Panics

Panics if there are no packages in this Workspace.

Trait Implementations

impl<'g> Clone for Workspace<'g>[src]

impl<'g> Debug for Workspace<'g>[src]

Auto Trait Implementations

impl<'g> RefUnwindSafe for Workspace<'g>[src]

impl<'g> Send for Workspace<'g>[src]

impl<'g> Sync for Workspace<'g>[src]

impl<'g> Unpin for Workspace<'g>[src]

impl<'g> UnwindSafe for Workspace<'g>[src]

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<'a, T> DefaultFeatures<'a> for T where
    T: 'a + Clone + Send + Sync
[src]

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

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

impl<'a, T> NonSyncFeatures<'a> for T where
    T: 'a + Clone
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> SafeBorrow<T> for T where
    T: ?Sized
[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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,