imag/src/storage/mod.rs

19 lines
398 B
Rust
Raw Normal View History

2015-10-18 19:59:17 +00:00
pub use std::path::Path;
pub use std::fs::File;
2015-10-19 15:31:43 +00:00
pub use std::error::Error;
2015-10-18 19:59:17 +00:00
pub use runtime::Runtime;
2015-10-30 13:32:22 +00:00
mod file;
2015-10-18 19:59:17 +00:00
pub trait StorageBackend {
fn name(&self) -> String;
2015-10-19 15:31:43 +00:00
fn create(&self, file : File) -> Option<Error>;
fn read(&self, path: Path) -> Result<File, Error>;
fn update(&self, file : File) -> Option<Error>;
fn destroy(&self, path: Path) -> Option<Error>;
2015-10-18 19:59:17 +00:00
}