#packaging #index #dependencies #crate #meta

crates-index

Library for retrieving and interacting with the crates.io index

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 May 27, 2015

#14 in Development tools

Download history 12771/week @ 2022-01-25 12718/week @ 2022-02-01 12778/week @ 2022-02-08 13515/week @ 2022-02-15 14642/week @ 2022-02-22 15624/week @ 2022-03-01 14300/week @ 2022-03-08 15183/week @ 2022-03-15 15513/week @ 2022-03-22 15086/week @ 2022-03-29 14742/week @ 2022-04-05 14442/week @ 2022-04-12 15610/week @ 2022-04-19 15535/week @ 2022-04-26 14576/week @ 2022-05-03 11768/week @ 2022-05-10

59,300 downloads per month
Used in 34 crates (20 directly)

Apache-2.0

50KB
1K SLoC

rust-crates-index

crates-index on Crates.io

Library for retrieving and interacting with the crates.io registry git-based index.

Documentation

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 and BareIndexRepo have become the Index.
  • Index::new_cargo_default()? is the preferred way of accessing the index. Use with_path() to clone to a different directory.
  • There's no need to call retrieve() or exists(). It's always retrieved and always exists.
  • retrieve_or_update() is just update().
  • highest_version() returns crate metadata rather than just the version number. Call highest_version().version().parse() to get semver::Version.
  • There's no crate_index_paths(), because there are no files any more. Use crate_ to get individual crates.

Similar crates

License

Licensed under version 2 of the Apache License

Dependencies

~13MB
~314K SLoC