Module registry

Module registry 

Source
Expand description

crates.io registry client.

Provides access to crates.io via:

All HTTP requests are cached aggressively using ETag/Last-Modified headers.

§Examples

use deps_cargo::CratesIoRegistry;
use deps_core::HttpCache;
use std::sync::Arc;

#[tokio::main]
async fn main() {
    let cache = Arc::new(HttpCache::new());
    let registry = CratesIoRegistry::new(cache);

    let versions = registry.get_versions("serde").await.unwrap();
    println!("Latest serde: {}", versions[0].num);
}

Structs§

CratesIoRegistry
Client for interacting with crates.io registry.

Constants§

CRATES_IO_URL
Base URL for crate pages on crates.io

Functions§

crate_url
Returns the URL for a crate’s page on crates.io.