33 releases
0.18.7 | Feb 27, 2022 |
---|---|
0.18.2 | Jan 20, 2022 |
0.18.1 | Oct 26, 2021 |
0.17.0 | Jul 8, 2021 |
0.1.2 |
|
#14 in Development tools
59,300 downloads per month
Used in 34 crates
(20 directly)
50KB
1K
SLoC
rust-crates-index
Library for retrieving and interacting with the crates.io registry git-based index.
Example
let index = crates_index::Index::new_cargo_default()?;
for crate_releases in index.crates() {
let _ = crate_releases.latest_version(); // any version most recently published
let crate_version = crate_releases.highest_version(); // max version by semver
println!("crate name: {}", crate_version.name());
println!("crate version: {}", crate_version.version());
}
Migration from 0.16 and 0.17
BareIndex
andBareIndexRepo
have become theIndex
.Index::new_cargo_default()?
is the preferred way of accessing the index. Usewith_path()
to clone to a different directory.- There's no need to call
retrieve()
orexists()
. It's always retrieved and always exists. retrieve_or_update()
is justupdate()
.highest_version()
returns crate metadata rather than just the version number. Callhighest_version().version().parse()
to getsemver::Version
.- There's no
crate_index_paths()
, because there are no files any more. Usecrate_
to get individual crates.
Similar crates
License
Licensed under version 2 of the Apache License
Dependencies
~13MB
~314K SLoC