diff --git a/libimagstore/src/store.rs b/libimagstore/src/store.rs new file mode 100644 index 00000000..5dd45d9c --- /dev/null +++ b/libimagstore/src/store.rs @@ -0,0 +1,17 @@ +use std::result::Result as RResult; +use std::string; + +pub use entry::Entry; +pub use error::StoreError; + +pub type Result = RResult; +pub type LockedEntry = SingleUseLock; + +pub trait Store { + fn create(&self, entry : Entry) -> Result<()>; + fn retrieve(&self, id : string) -> Result; + fn retrieve_copy(&self, id : string) -> Result; + fn update(&self, LockedEntry) -> Result<()>; + fn delete(&self, id : string) -> Result<()>; +} +