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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)