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§
source§impl<'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§
source§impl<'g> Clone for PackageLink<'g>
impl<'g> Clone for PackageLink<'g>
source§fn clone(&self) -> PackageLink<'g>
fn clone(&self) -> PackageLink<'g>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<'g> Debug for PackageLink<'g>
impl<'g> Debug for PackageLink<'g>
impl<'g> Copy for PackageLink<'g>
Auto Trait Implementations§
impl<'g> Freeze for PackageLink<'g>
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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)