Struct cargo::core::dependency::Dependency
[−]
[src]
pub struct Dependency { /* fields omitted */ }
Information about a dependency requested by a Cargo manifest. Cheap to copy.
Methods
impl Dependency
[src]
fn parse(
name: &str,
version: Option<&str>,
source_id: &SourceId,
inside: &PackageId,
config: &Config
) -> CargoResult<Dependency>
name: &str,
version: Option<&str>,
source_id: &SourceId,
inside: &PackageId,
config: &Config
) -> CargoResult<Dependency>
Attempt to create a Dependency
from an entry in the manifest.
fn parse_no_deprecated(
name: &str,
version: Option<&str>,
source_id: &SourceId
) -> CargoResult<Dependency>
name: &str,
version: Option<&str>,
source_id: &SourceId
) -> CargoResult<Dependency>
Attempt to create a Dependency
from an entry in the manifest.
fn new_override(name: &str, source_id: &SourceId) -> Dependency
fn version_req(&self) -> &VersionReq
fn name(&self) -> &str
fn source_id(&self) -> &SourceId
fn kind(&self) -> Kind
fn specified_req(&self) -> bool
fn platform(&self) -> Option<&Platform>
If none, this dependencies must be built for all platforms. If some, it must only be built for the specified platform.
fn set_kind(&mut self, kind: Kind) -> &mut Dependency
fn set_features(&mut self, features: Vec<String>) -> &mut Dependency
Sets the list of features requested for the package.
fn set_default_features(&mut self, default_features: bool) -> &mut Dependency
Sets whether the dependency requests default features of the package.
fn set_optional(&mut self, optional: bool) -> &mut Dependency
Sets whether the dependency is optional.
fn set_source_id(&mut self, id: SourceId) -> &mut Dependency
Set the source id for this dependency
fn set_version_req(&mut self, req: VersionReq) -> &mut Dependency
Set the version requirement for this dependency
fn set_platform(&mut self, platform: Option<Platform>) -> &mut Dependency
fn lock_to(&mut self, id: &PackageId) -> &mut Dependency
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.
fn map_source(
self,
to_replace: &SourceId,
replace_with: &SourceId
) -> Dependency
self,
to_replace: &SourceId,
replace_with: &SourceId
) -> Dependency
Trait Implementations
impl PartialEq for Dependency
[src]
fn eq(&self, __arg_0: &Dependency) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Dependency) -> bool
This method tests for !=
.
impl Clone for Dependency
[src]
fn clone(&self) -> Dependency
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more