summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2018-06-19 21:23:10 -0300
committerMatthias Beyer <mail@beyermatthias.de>2018-06-23 21:56:03 +0200
commit3bdd5c959be8426ad2a22ab4e3ce1082050917b9 (patch)
tree522efd997aa661c13947763f9ff1bde30044e29f /lib
parentc86e4e7db4d933d524f9ab32161663f04566e148 (diff)
Add documentation to StoreId type
Diffstat (limited to 'lib')
-rw-r--r--lib/core/libimagstore/src/storeid.rs9
1 files changed, 9 insertions, 0 deletions
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<PathBuf>,
@@ -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<bool> {
self.clone().into_pathbuf().map(|pb| pb.exists())
}