Add Store type

This commit is contained in:
Matthias Beyer 2015-12-27 23:03:57 +01:00
parent 73c7281259
commit cb2c512440
1 changed files with 22 additions and 0 deletions

View File

@ -1,4 +1,26 @@
use std::cell::RefCell;
use std::collections::HashMap;
pub mod path;
pub mod file;
pub mod parser;
pub mod json;
use storage::file::File;
use storage::file::id::FileID;
type Cache<'a> = HashMap<FileID, RefCell<File<'a>>>;
pub struct Store<'a> {
cache : RefCell<Cache<'a>>,
}
impl<'a> Store<'a> {
pub fn new() -> Store<'a> {
Store {
cache: RefCell::new(HashMap::new()),
}
}
}