pub struct CrateVersion {
pub name: String,
pub vers: Version,
pub deps: Vec<Dependency>,
pub cksum: String,
pub features: HashMap<String, Vec<String>>,
pub yanked: bool,
pub links: Option<String>,
pub v: u32,
pub features2: HashMap<String, Vec<String>>,
}
index
only.Fields§
§name: String
The name of the package.
This must only contain alphanumeric, -
, or _
characters.
vers: Version
The version of the package this row is describing.
This must be a valid version number according to the Semantic Versioning 2.0.0 spec at https://semver.org/.
deps: Vec<Dependency>
Array of direct dependencies of the package.
cksum: String
A SHA256 checksum of the .crate
file.
features: HashMap<String, Vec<String>>
Set of features defined for the package.
Each feature maps to an array of features or dependencies it enables.
yanked: bool
Boolean of whether or not this version has been yanked.
links: Option<String>
The links
string value from the package’s manifest, or null if not specified.
This field is optional and defaults to null.
v: u32
An unsigned 32-bit integer value indicating the schema version of this entry.
If this not specified, it should be interpreted as the default of 1.
Cargo (starting with version 1.51) will ignore versions it does not recognize. This provides a method to safely introduce changes to index entries and allow older versions of cargo to ignore newer entries it doesn’t understand. Versions older than 1.51 ignore this field, and thus may misinterpret the meaning of the index entry.
The current values are:
- 1: The schema as documented here, not including newer additions. This is honored in Rust version 1.51 and newer.
- 2: The addition of the
features2
field. This is honored in Rust version 1.60 and newer.
features2: HashMap<String, Vec<String>>
This optional field contains features with new, extended syntax.
Specifically, namespaced features (dep:
) and weak dependencies (pkg?/feat
).
This is separated from features
because versions older than 1.19 will fail to load due to
not being able to parse the new syntax, even with a Cargo.lock
file.
Cargo will merge any values listed here with the “features” field.
If this field is included, the “v” field should be set to at least 2.
Registries are not required to use this field for extended feature syntax, they are allowed to include those in the “features” field. Using this is only necessary if the registry wants to support cargo versions older than 1.19, which in practice is only crates.io since those older versions do not support other registries.
Implementations§
Source§impl CrateVersion
impl CrateVersion
Trait Implementations§
Source§impl Clone for CrateVersion
impl Clone for CrateVersion
Source§fn clone(&self) -> CrateVersion
fn clone(&self) -> CrateVersion
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more