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>>,
}
Available on crate feature 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.

Trait Implementations§

source§

impl Clone for CrateVersion

source§

fn clone(&self) -> CrateVersion

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'de> Deserialize<'de> for CrateVersion

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for CrateVersion

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,