Struct cargo::core::dependency::DependencyInner
[−]
[src]
pub struct DependencyInner { // some fields omitted }
The data underlying a Dependency.
Methods
impl DependencyInner
fn parse(name: &str, version: Option<&str>, source_id: &SourceId) -> CargoResult<DependencyInner>
Attempt to create a Dependency
from an entry in the manifest.
fn new_override(name: &str, source_id: &SourceId) -> DependencyInner
fn version_req(&self) -> &VersionReq
fn name(&self) -> &str
fn source_id(&self) -> &SourceId
fn kind(&self) -> Kind
fn specified_req(&self) -> Option<&str>
fn only_for_platform(&self) -> Option<&str>
If none, this dependencies must be built for all platforms. If some, it must only be built for the specified platform.
fn set_kind(self, kind: Kind) -> DependencyInner
fn set_features(self, features: Vec<String>) -> DependencyInner
Sets the list of features requested for the package.
fn set_default_features(self, default_features: bool) -> DependencyInner
Sets whether the dependency requests default features of the package.
fn set_optional(self, optional: bool) -> DependencyInner
Sets whether the dependency is optional.
fn set_source_id(self, id: SourceId) -> DependencyInner
Set the source id for this dependency
fn set_version_req(self, req: VersionReq) -> DependencyInner
Set the version requirement for this dependency
fn set_only_for_platform(self, platform: Option<String>) -> DependencyInner
fn lock_to(self, id: &PackageId) -> DependencyInner
Lock this dependency to depending on the specified package id
fn is_transitive(&self) -> bool
Returns false if the dependency is only used to build the local package.
fn is_build(&self) -> bool
fn is_optional(&self) -> bool
fn uses_default_features(&self) -> bool
Returns true if the default features of the dependency are requested.
fn features(&self) -> &[String]
Returns the list of features that are requested by the dependency.
fn matches(&self, sum: &Summary) -> bool
Returns true if the package (sum
) can fulfill this dependency request.
fn matches_id(&self, id: &PackageId) -> bool
Returns true if the package (id
) can fulfill this dependency request.