Add documentation to StoreId type

This commit is contained in:
Matthias Beyer 2018-06-19 21:23:10 -03:00
parent c86e4e7db4
commit 3bdd5c959b

View file

@ -38,6 +38,10 @@ use iter::get::StoreGetIterator;
use iter::retrieve::StoreRetrieveIterator; use iter::retrieve::StoreRetrieveIterator;
/// The Index into the Store /// 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)] #[derive(Debug, Clone, Hash, Eq, PartialOrd, Ord)]
pub struct StoreId { pub struct StoreId {
base: Option<PathBuf>, base: Option<PathBuf>,
@ -104,6 +108,11 @@ impl StoreId {
Ok(base) Ok(base)
} }
/// Check whether the StoreId exists (as in whether the file exists)
///
/// # Warning
///
/// Should be considered deprecated
pub fn exists(&self) -> Result<bool> { pub fn exists(&self) -> Result<bool> {
self.clone().into_pathbuf().map(|pb| pb.exists()) self.clone().into_pathbuf().map(|pb| pb.exists())
} }