Skip to main content

version_exists

Function version_exists 

Source
pub fn version_exists(crate_name: &str, version: &str) -> Result<bool, Error>
Expand description

Returns true if the given version of a crate exists in the crates.io index, or false if the crate is found but the version is absent.

Returns an error if the crate is not found on the index or if the index cannot be queried.

§Errors

Returns Error::CrateNotFoundOnIndex when the crate is absent from the index. Returns other Error variants on index access failures.

§Examples

use kdeets_lib::version_exists;

let exists = version_exists("serde", "1.0.0")?;
assert!(exists);