Struct tame_index::krate::IndexVersion
source · pub struct IndexVersion {
pub name: SmolStr,
pub version: SmolStr,
pub deps: Arc<[IndexDependency]>,
pub checksum: Chksum,
pub yanked: bool,
pub links: Option<Box<SmolStr>>,
pub rust_version: Option<SmolStr>,
/* private fields */
}
Expand description
A single version of a crate (package) published to the index
Fields§
§name: SmolStr
§version: SmolStr
§deps: Arc<[IndexDependency]>
§checksum: Chksum
The SHA-256 for this crate version’s tarball
yanked: bool
Whether the crate is yanked from the remote index or not
links: Option<Box<SmolStr>>
§rust_version: Option<SmolStr>
Implementations§
source§impl IndexVersion
impl IndexVersion
sourcepub fn dependencies(&self) -> &[IndexDependency]
pub fn dependencies(&self) -> &[IndexDependency]
Dependencies for this version
sourcepub fn checksum(&self) -> &[u8; 32]
pub fn checksum(&self) -> &[u8; 32]
Checksum of the package for this version
SHA256 of the .crate file
sourcepub fn features(&self) -> impl Iterator<Item = (&String, &Vec<String>)>
pub fn features(&self) -> impl Iterator<Item = (&String, &Vec<String>)>
Explicit feature set for this crate.
This list is not exhaustive, because any optional dependency becomes a feature automatically.
default
is a special feature name for implicitly enabled features.
sourcepub fn links(&self) -> Option<&str>
pub fn links(&self) -> Option<&str>
Exclusivity flag. If this is a sys crate, it informs it conflicts with any other crate with the same links string.
It does not involve linker or libraries in any way.
sourcepub fn rust_version(&self) -> Option<&str>
pub fn rust_version(&self) -> Option<&str>
Required version of rust
Corresponds to package.rust-version
.
Added in 2023 (see https://github.com/rust-lang/crates.io/pull/6267),
can be None
if published before then or if not set in the manifest.
sourcepub fn download_url(&self, index: &IndexConfig) -> Option<String>
pub fn download_url(&self, index: &IndexConfig) -> Option<String>
Retrieves the URL this crate version’s tarball can be downloaded from
Trait Implementations§
source§impl Clone for IndexVersion
impl Clone for IndexVersion
source§fn clone(&self) -> IndexVersion
fn clone(&self) -> IndexVersion
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for IndexVersion
impl Debug for IndexVersion
source§impl<'de> Deserialize<'de> for IndexVersion
impl<'de> Deserialize<'de> for IndexVersion
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for IndexVersion
impl PartialEq for IndexVersion
source§fn eq(&self, other: &IndexVersion) -> bool
fn eq(&self, other: &IndexVersion) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for IndexVersion
impl Serialize for IndexVersion
impl Eq for IndexVersion
impl StructuralPartialEq for IndexVersion
Auto Trait Implementations§
impl Freeze for IndexVersion
impl RefUnwindSafe for IndexVersion
impl Send for IndexVersion
impl Sync for IndexVersion
impl Unpin for IndexVersion
impl UnwindSafe for IndexVersion
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.