Add Store type
This commit is contained in:
parent
73c7281259
commit
cb2c512440
1 changed files with 22 additions and 0 deletions
|
@ -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()),
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue