pub struct ConditionalLink<'g> { /* private fields */ }
Expand description
A feature dependency that is conditionally activated.
A ConditionalLink
is typically a link across packages. For example:
[package]
name = "main"
[dependencies]
dep = { ... }
[dev-dependencies]
dev-dep = { ... }
[target.'cfg(unix)'.dependencies]
unix-dep = { ... }
[features]
feat = ["dep/feat", "dev-dep/feat", "unix-dep/feat"]
In this example, there are ConditionalLink
s from main/feat
to dep/feat
, dev-dep/feat
and
unix-dep/feat
. Each link is only activated if the conditions for it are met. For example,
the link to dev-dep/feat
is only followed if Cargo is interested in dev-dependencies of main
.
If a dependency, for example unix-dep
above, is optional, an implicit feature is created in
the package main
with the name unix-dep
. In this case, the dependency from main/feat
to
main/unix-dep
is also a ConditionalLink
representing the same cfg(unix)
condition.
Implementations§
Source§impl<'g> ConditionalLink<'g>
impl<'g> ConditionalLink<'g>
Sourcepub fn from(&self) -> FeatureMetadata<'g>
pub fn from(&self) -> FeatureMetadata<'g>
Returns the feature which depends on the to
feature.
Sourcepub fn to(&self) -> FeatureMetadata<'g>
pub fn to(&self) -> FeatureMetadata<'g>
Returns the feature which is depended on by the from
feature.
Sourcepub fn endpoints(&self) -> (FeatureMetadata<'g>, FeatureMetadata<'g>)
pub fn endpoints(&self) -> (FeatureMetadata<'g>, FeatureMetadata<'g>)
Returns the endpoints as a pair of features (from, to)
.
Sourcepub fn normal(&self) -> PlatformStatus<'g>
pub fn normal(&self) -> PlatformStatus<'g>
Returns details about this feature dependency from the [dependencies]
section.
Sourcepub fn build(&self) -> PlatformStatus<'g>
pub fn build(&self) -> PlatformStatus<'g>
Returns details about this feature dependency from the [build-dependencies]
section.
Sourcepub fn dev(&self) -> PlatformStatus<'g>
pub fn dev(&self) -> PlatformStatus<'g>
Returns details about this feature dependency from the [dev-dependencies]
section.
Sourcepub fn status_for_kind(&self, kind: DependencyKind) -> PlatformStatus<'g>
pub fn status_for_kind(&self, kind: DependencyKind) -> PlatformStatus<'g>
Returns details about this feature dependency from the section specified by the given dependency kind.
Sourcepub fn dev_only(&self) -> bool
pub fn dev_only(&self) -> bool
Returns true if this edge is dev-only, i.e. code from this edge will not be included in normal builds.
Sourcepub fn package_link(&self) -> PackageLink<'g>
pub fn package_link(&self) -> PackageLink<'g>
Returns the PackageLink
from which this ConditionalLink
was derived.
Trait Implementations§
Source§impl<'g> Clone for ConditionalLink<'g>
impl<'g> Clone for ConditionalLink<'g>
Source§fn clone(&self) -> ConditionalLink<'g>
fn clone(&self) -> ConditionalLink<'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 ConditionalLink<'g>
impl<'g> Debug for ConditionalLink<'g>
impl<'g> Copy for ConditionalLink<'g>
Auto Trait Implementations§
impl<'g> Freeze for ConditionalLink<'g>
impl<'g> RefUnwindSafe for ConditionalLink<'g>
impl<'g> Send for ConditionalLink<'g>
impl<'g> Sync for ConditionalLink<'g>
impl<'g> Unpin for ConditionalLink<'g>
impl<'g> UnwindSafe for ConditionalLink<'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
)