pub struct Version { /* private fields */ }
Expand description
A single version of a crate (package) published to the index
Implementations§
Source§impl Version
impl Version
Sourcepub fn dependencies(&self) -> &[Dependency]
pub fn dependencies(&self) -> &[Dependency]
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) -> &HashMap<String, Vec<String>>
pub fn features(&self) -> &HashMap<String, Vec<String>>
Explicit features this crate has. 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>
Where to find crate tarball
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Version
impl<'de> Deserialize<'de> for Version
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Version
impl RefUnwindSafe for Version
impl Send for Version
impl Sync for Version
impl Unpin for Version
impl UnwindSafe for Version
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
Mutably borrows from an owned value. Read more
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)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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>
Converts
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>
Converts
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