pub struct Dependency {
pub name: String,
pub req: VersionReq,
pub features: Vec<String>,
pub optional: bool,
pub default_features: bool,
pub target: Option<String>,
pub kind: DependencyKind,
pub registry: Option<String>,
pub package: Option<String>,
}index only.Fields§
§name: StringName of the dependency.
If the dependency is renamed from the original package name, this is the new name.
The original package name is stored in the package field.
req: VersionReqThe SemVer requirement for this dependency.
This must be a valid version requirement defined at https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html.
features: Vec<String>Array of features (as strings) enabled for this dependency.
optional: boolBoolean of whether or not this is an optional dependency.
default_features: boolBoolean of whether or not default features are enabled.
target: Option<String>The target platform for the dependency.
null if not a target dependency. Otherwise, a string such as cfg(windows).
kind: DependencyKindThe dependency kind.
“dev”, “build”, or “normal”. Note: this is a required field, but a small number of entries exist in the crates.io index with either a missing or null kind` field due to implementation bugs.
registry: Option<String>The URL of the index of the registry where this dependency is from as a string.
If not specified or null, it is assumed the dependency is in the current registry.
package: Option<String>If the dependency is renamed, this is a string of the actual package name.
If not specified or null, this dependency is not renamed.
Trait Implementations§
Source§impl Clone for Dependency
impl Clone for Dependency
Source§fn clone(&self) -> Dependency
fn clone(&self) -> Dependency
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more