diff --git a/src/errors.rs b/src/errors.rs index a3677ae..d167b8c 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -5,6 +5,7 @@ use chownr; use failure::Fail; use serde_json; +/// Error type returned by all API calls. #[derive(Fail, Debug)] pub enum Error { #[fail(display = "not found")] diff --git a/src/get.rs b/src/get.rs index 352498c..a5a2fc2 100644 --- a/src/get.rs +++ b/src/get.rs @@ -1,3 +1,4 @@ +//! Functions for reading from cache. use std::path::Path; use ssri::Integrity; diff --git a/src/index.rs b/src/index.rs index 7120917..186db2b 100644 --- a/src/index.rs +++ b/src/index.rs @@ -18,6 +18,7 @@ use crate::errors::Error; const INDEX_VERSION: &str = "5"; +/// Represents a cache index entry, which points to content. #[derive(PartialEq, Debug)] pub struct Entry { pub key: String, diff --git a/src/lib.rs b/src/lib.rs index 2d4771a..8914c9b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,7 @@ +//! cacache is a Rust library for managing local key and content address +//! caches. It's really fast, really good at concurrency, and it will never +//! give you corrupted data, even if cache files get corrupted or manipulated. + mod content; pub mod get; pub mod put; diff --git a/src/put.rs b/src/put.rs index 9c3fbca..3574b01 100644 --- a/src/put.rs +++ b/src/put.rs @@ -1,3 +1,4 @@ +//! Functions for writing to cache. use std::path::{Path, PathBuf}; use nix::unistd::{Uid, Gid}; diff --git a/src/rm.rs b/src/rm.rs index 9f4b667..7be1387 100644 --- a/src/rm.rs +++ b/src/rm.rs @@ -1,3 +1,4 @@ +//! Functions for removing things from the cache. use std::fs; use std::path::Path;