Enum guppy::graph::PackageSource [−][src]
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 Utf8Path)
This package is in the workspace.
The path is relative to the workspace root.
Path(&'g Utf8Path)
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 Utf8Path>
[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 Utf8Path>
[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]
fn clone(&self) -> PackageSource<'g>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[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]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'g> PartialEq<PackageSource<'g>> for PackageSource<'g>
[src]
fn eq(&self, other: &PackageSource<'g>) -> bool
[src]
fn ne(&self, other: &PackageSource<'g>) -> bool
[src]
impl<'g> PartialEq<SummarySource> for PackageSource<'g>
[src]
fn eq(&self, summary_source: &SummarySource) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'g> StructuralEq for PackageSource<'g>
[src]
impl<'g> StructuralPartialEq for PackageSource<'g>
[src]
Auto Trait Implementations
impl<'g> RefUnwindSafe for PackageSource<'g>
impl<'g> Send for PackageSource<'g>
impl<'g> Sync for PackageSource<'g>
impl<'g> Unpin for PackageSource<'g>
impl<'g> UnwindSafe for PackageSource<'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,
pub 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,
pub fn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a> + 'a, Global>
[src]
pub fn self_address_mut(&mut self) -> *mut ()
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[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,
pub fn clone_boxed(&self) -> Box<dyn NonSyncFeatures<'a> + 'a, Global>
[src]
pub fn self_address_mut(&mut self) -> *mut ()
[src]
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> SafeBorrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub 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.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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.
pub 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.
pub 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>,