[−][src]Struct guppy::graph::Workspace
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]
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 iter(
&self
) -> impl Iterator<Item = PackageMetadata<'g>> + ExactSizeIterator
[src]
&self
) -> impl Iterator<Item = PackageMetadata<'g>> + ExactSizeIterator
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]
&self
) -> impl Iterator<Item = (&'g Path, 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
[src]
&self
) -> impl Iterator<Item = (&'g str, PackageMetadata<'g>)> + ExactSizeIterator
Returns an iterator over workspace names and package metadatas, sorted by names.
pub fn member_ids(
&self
) -> impl Iterator<Item = &'g PackageId> + ExactSizeIterator
[src]
&self
) -> impl Iterator<Item = &'g PackageId> + ExactSizeIterator
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]
&self,
path: impl AsRef<Path>
) -> 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<Path>>
) -> Result<B, Error> where
B: FromIterator<PackageMetadata<'g>>,
[src]
&self,
paths: impl IntoIterator<Item = impl AsRef<Path>>
) -> 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.
pub fn member_by_name(
&self,
name: impl AsRef<str>
) -> Result<PackageMetadata<'g>, Error>
[src]
&self,
name: impl AsRef<str>
) -> Result<PackageMetadata<'g>, Error>
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]
&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.
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
Auto Trait Implementations
impl<'g> RefUnwindSafe for Workspace<'g>
impl<'g> Send for Workspace<'g>
impl<'g> Sync for Workspace<'g>
impl<'g> Unpin for Workspace<'g>
impl<'g> UnwindSafe for Workspace<'g>
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<'a, T> DefaultFeatures<'a> for T where
T: 'a + Clone + Send + Sync,
[src]
T: 'a + Clone + Send + Sync,
fn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a> + 'a>
[src]
fn self_address_mut(&mut self) -> *mut ()
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<'a, T> NonSyncFeatures<'a> for T where
T: 'a + Clone,
[src]
T: 'a + Clone,
fn clone_boxed(&self) -> Box<dyn NonSyncFeatures<'a> + 'a>
[src]
fn self_address_mut(&mut self) -> *mut ()
[src]
impl<T> SafeBorrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_replacement(ptr: &T) -> &T
[src]
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,