From 3bdd5c959be8426ad2a22ab4e3ce1082050917b9 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Tue, 19 Jun 2018 21:23:10 -0300 Subject: [PATCH] Add documentation to StoreId type --- lib/core/libimagstore/src/storeid.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/core/libimagstore/src/storeid.rs b/lib/core/libimagstore/src/storeid.rs index 3d639797..66a94c49 100644 --- a/lib/core/libimagstore/src/storeid.rs +++ b/lib/core/libimagstore/src/storeid.rs @@ -38,6 +38,10 @@ use iter::get::StoreGetIterator; use iter::retrieve::StoreRetrieveIterator; /// The Index into the Store +/// +/// A StoreId object is a unique identifier for one entry in the store which might be present or +/// not. +/// #[derive(Debug, Clone, Hash, Eq, PartialOrd, Ord)] pub struct StoreId { base: Option, @@ -104,6 +108,11 @@ impl StoreId { Ok(base) } + /// Check whether the StoreId exists (as in whether the file exists) + /// + /// # Warning + /// + /// Should be considered deprecated pub fn exists(&self) -> Result { self.clone().into_pathbuf().map(|pb| pb.exists()) }