From fa8759b92c9f377ca4ccb5691fc70f3432b5b7d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kat=20March=C3=A1n?= Date: Sun, 30 Jun 2019 20:18:47 -0700 Subject: [PATCH] doc(rm): document rm API functions --- src/rm.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/rm.rs b/src/rm.rs index 503e05a..f388db2 100644 --- a/src/rm.rs +++ b/src/rm.rs @@ -8,14 +8,20 @@ use crate::content::rm; use crate::errors::Error; use crate::index; +/// Removes an individual index entry. The associated content will be left +/// intact. pub fn entry>(cache: P, key: &str) -> Result<(), Error> { index::delete(cache.as_ref(), &key) } +/// Removes an individual content entry. Any index entries pointing to this +/// content will become invalidated. pub fn content>(cache: P, sri: &Integrity) -> Result<(), Error> { rm::rm(cache.as_ref(), &sri) } +/// Removes entire contents of the cache, including temporary files, the entry +/// index, and all content data. pub fn all>(cache: P) -> Result<(), Error> { for entry in cache.as_ref().read_dir()? { if let Ok(entry) = entry {