crate-index

Crates.iocrate-index
lib.rscrate-index
version0.1.0
sourcesrc
created_at2020-02-29 21:57:15.565697
updated_at2020-04-17 11:51:40.441335
descriptionA small library for managing a Cargo crate index
homepagehttps://github.com/Rust-Bucket/Crate-Index
repositoryhttps://github.com/Rust-Bucket/Crate-Index
max_upload_size
id213983
size76,364
(danieleades)

documentation

https://docs.rs/crate-index

README

Released API docs Continuous integration Coverage Status

Crate Index

Crate-Index is a library for managing and manipulating a Cargo crate registry.

see the cargo docs for details

Basic Usage

use crate_index::{Index, Url, Metadata, Version};

// Create a new index, backed by the filesystem and a git repository
let root = "/index";
let download = "https://my-crates-server.com/api/v1/crates/{crate}/{version}/download";

let mut index = Index::initialise(root, download)
    .build()
    .await?;

// Create a new crate 'Metadata' object
let name = "foo";
let version = Version::parse("0.1.0").unwrap();
let check_sum = "d867001db0e2b6e0496f9fac96930e2d42233ecd3ca0413e0753d4c7695d289c";

let metadata = Metadata::new(name, version, check_sum);

// Insert the Metadata into the index
index.insert(metadata).await?;

License

Commit count: 36

cargo fmt