Struct guppy::graph::PackageLink
source · [−]pub struct PackageLink<'g> { /* private fields */ }
Expand description
Represents a dependency from one package to another.
This struct contains information about:
- whether this dependency was renamed in the context of this crate.
- if this is a normal, dev and/or build dependency.
- platform-specific information about required, optional and status
Implementations
sourceimpl<'g> PackageLink<'g>
impl<'g> PackageLink<'g>
sourcepub fn from(&self) -> PackageMetadata<'g>
pub fn from(&self) -> PackageMetadata<'g>
Returns the package which depends on the to
package.
sourcepub fn to(&self) -> PackageMetadata<'g>
pub fn to(&self) -> PackageMetadata<'g>
Returns the package which is depended on by the from
package.
sourcepub fn endpoints(&self) -> (PackageMetadata<'g>, PackageMetadata<'g>)
pub fn endpoints(&self) -> (PackageMetadata<'g>, PackageMetadata<'g>)
Returns the endpoints as a pair of packages (from, to)
.
sourcepub fn dep_name(&self) -> &'g str
pub fn dep_name(&self) -> &'g str
Returns the name for this dependency edge. This can be affected by a crate rename.
sourcepub fn resolved_name(&self) -> &'g str
pub fn resolved_name(&self) -> &'g str
Returns the resolved name for this dependency edge. This may involve renaming the crate and replacing - with _.
sourcepub fn version_req(&self) -> &'g VersionReq
pub fn version_req(&self) -> &'g VersionReq
Returns the semver requirements specified for this dependency.
To get the resolved version, see the to
field of the PackageLink
this was part of.
Notes
A dependency can be requested multiple times, possibly with different version requirements,
even if they all end up resolving to the same version. version_req
will return any of
those requirements.
See Specifying Dependencies in the Cargo reference for more details.
sourcepub fn normal(&self) -> DependencyReq<'g>
pub fn normal(&self) -> DependencyReq<'g>
Returns details about this dependency from the [dependencies]
section.
sourcepub fn build(&self) -> DependencyReq<'g>
pub fn build(&self) -> DependencyReq<'g>
Returns details about this dependency from the [build-dependencies]
section.
sourcepub fn dev(&self) -> DependencyReq<'g>
pub fn dev(&self) -> DependencyReq<'g>
Returns details about this dependency from the [dev-dependencies]
section.
sourcepub fn req_for_kind(&self, kind: DependencyKind) -> DependencyReq<'g>
pub fn req_for_kind(&self, kind: DependencyKind) -> DependencyReq<'g>
Returns details about this dependency from the section specified by the given dependency kind.
Trait Implementations
sourceimpl<'g> Clone for PackageLink<'g>
impl<'g> Clone for PackageLink<'g>
sourcefn clone(&self) -> PackageLink<'g>
fn clone(&self) -> PackageLink<'g>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'g> Debug for PackageLink<'g>
impl<'g> Debug for PackageLink<'g>
impl<'g> Copy for PackageLink<'g>
Auto Trait Implementations
impl<'g> RefUnwindSafe for PackageLink<'g>
impl<'g> Send for PackageLink<'g>
impl<'g> Sync for PackageLink<'g>
impl<'g> Unpin for PackageLink<'g>
impl<'g> UnwindSafe for PackageLink<'g>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more