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§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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more