Struct guppy::graph::Workspace

source ·
pub struct Workspace<'g> { /* private fields */ }
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§

These parallel iterators require the rayon1 feature is enabled.

Available on crate feature rayon1 only.

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

Requires the rayon1 feature to be enabled.

Available on crate feature rayon1 only.

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

Requires the rayon1 feature to be enabled.

Available on crate feature rayon1 only.

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

Requires the rayon1 feature to be enabled.

Returns the workspace root.

Returns the target directory in which output artifacts are stored.

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.

Returns an iterator over workspace paths and package metadatas, sorted by the path they’re in.

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.

Maps the given path to the corresponding workspace member.

Returns an error if the path didn’t match any workspace members.

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.

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.

Returns the freeform metadata table for this workspace.

This is the same as the workspace.metadata section of Cargo.toml. This section is typically used by tools which would like to store workspace configuration in Cargo.toml.

Helpers for property testing

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

Currently, proptest 1 is supported if the proptest1 feature is enabled.

Available on crate feature proptest1 only.

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

Requires the proptest1 feature to be enabled.

Panics

Panics if there are no packages in this Workspace.

Available on crate feature proptest1 only.

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

Requires the proptest1 feature to be enabled.

Panics

Panics if there are no packages in this Workspace.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.