Update Store and FSStore to use FileLockEntry

This commit is contained in:
Marcel Müller 2016-01-16 18:32:57 +01:00
parent 5ab6327d97
commit 676dc9073f
No known key found for this signature in database
GPG key ID: DD4ED37D0CAC76E2
2 changed files with 6 additions and 5 deletions

View file

@ -8,6 +8,7 @@ use std::sync::RwLock;
pub use store::Store; pub use store::Store;
pub use store::Result; pub use store::Result;
pub use store::FileLockEntry;
pub use entry::Entry; pub use entry::Entry;
pub use error::StoreError; pub use error::StoreError;
@ -44,7 +45,7 @@ impl Store for FSStore {
unimplemented!() unimplemented!()
} }
fn retrieve(&self, path: PathBuf) -> Result<Arc<RwLock<Entry>>> { fn retrieve<'a>(&'a self, path: PathBuf) -> Result<FileLockEntry<'a, Self>> {
unimplemented!() unimplemented!()
} }
@ -52,7 +53,7 @@ impl Store for FSStore {
unimplemented!() unimplemented!()
} }
fn update(&self, entry: Arc<RwLock<Entry>>) -> Result<()> { fn update<'a>(&'a self, entry: FileLockEntry<'a, Self>) -> Result<()> {
unimplemented!() unimplemented!()
} }

View file

@ -11,13 +11,13 @@ pub use error::StoreError;
pub type Result<T> = RResult<T, StoreError>; pub type Result<T> = RResult<T, StoreError>;
pub trait Store { pub trait Store : Sized {
fn location(&self) -> &PathBuf; fn location(&self) -> &PathBuf;
fn create(&self, entry: Entry) -> Result<()>; fn create(&self, entry: Entry) -> Result<()>;
fn retrieve(&self, path: PathBuf) -> Result<Arc<RwLock<Entry>>>; fn retrieve<'a>(&'a self, path: PathBuf) -> Result<FileLockEntry<'a, Self>>;
fn update(&self, entry: Arc<RwLock<Entry>>) -> Result<()>; fn update<'a>(&'a self, entry: FileLockEntry<'a, Self>) -> Result<()>;
fn retrieve_copy(&self, id : String) -> Result<Entry>; fn retrieve_copy(&self, id : String) -> Result<Entry>;
fn delete(&self, path: PathBuf) -> Result<()>; fn delete(&self, path: PathBuf) -> Result<()>;