Enum guppy::graph::PackageSource[][src]

pub enum PackageSource<'g> {
    Workspace(&'g Path),
    Path(&'g Path),
    External(&'g str),
}

The source of a package.

This enum contains information about where a package is found, and whether it is inside or outside the workspace.

Variants

Workspace(&'g Path)

This package is in the workspace.

The path is relative to the workspace root.

Path(&'g Path)

This package is a path dependency that isn't in the workspace.

The path is relative to the workspace root.

External(&'g str)

This package is an external dependency.

  • For packages retrieved from crates.io, the source is the string "registry+https://github.com/rust-lang/crates.io-index".
  • For packages retrieved from other registries, the source begins with "registry+".
  • For packages retrieved from Git repositories, the source begins with "git+".

Implementations

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

pub const CRATES_IO_REGISTRY: &'static str[src]

The path to the crates.io registry.

pub fn is_workspace(&self) -> bool[src]

Returns true if this package source represents a workspace.

pub fn is_path(&self) -> bool[src]

Returns true if this package source represents a path dependency that isn't in the workspace.

pub fn is_external(&self) -> bool[src]

Returns true if this package source represents an external dependency.

pub fn is_crates_io(&self) -> bool[src]

Returns true if the source is crates.io.

pub fn is_local(&self) -> bool[src]

Returns true if this package is a local dependency, i.e. either in the workspace or a local path.

pub fn workspace_path(&self) -> Option<&'g Path>[src]

Returns the path if this is a workspace dependency, or None if this is a non-workspace dependency.

The path is relative to the workspace root.

pub fn local_path(&self) -> Option<&'g Path>[src]

Returns the local path if this is a local dependency, or None if it is an external dependency.

The path is relative to the workspace root.

pub fn external_source(&self) -> Option<&'g str>[src]

Returns the external source if this is an external dependency, or None if it is a local dependency.

pub fn parse_external(&self) -> Option<ExternalSource<'g>>[src]

Attempts to parse an external source.

Returns None if the external dependency could not be recognized, or if it is a local dependency.

For more about external sources, see the documentation for ExternalSource.

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

pub fn to_summary_source(&self) -> SummarySource[src]

Converts a PackageSource into a SummarySource.

Requires the summaries feature to be enabled.

Trait Implementations

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

impl<'g> Copy for PackageSource<'g>[src]

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

impl<'g> Display for PackageSource<'g>[src]

impl<'g> Eq for PackageSource<'g>[src]

impl<'g> Hash for PackageSource<'g>[src]

impl<'g> PartialEq<PackageSource<'g>> for PackageSource<'g>[src]

impl<'g> PartialEq<SummarySource> for PackageSource<'g>[src]

impl<'g> StructuralEq for PackageSource<'g>[src]

impl<'g> StructuralPartialEq for PackageSource<'g>[src]

Auto Trait Implementations

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

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

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

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

impl<'g> UnwindSafe for PackageSource<'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<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[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> ToString for T where
    T: Display + ?Sized
[src]

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>,