Add StoreHandle::new()

This commit is contained in:
Matthias Beyer 2017-01-22 15:15:02 +01:00
parent 34cd5d9c87
commit bf53c6b529
1 changed files with 6 additions and 0 deletions

View File

@ -28,6 +28,12 @@ use libimagstore::store::Store;
#[derive(Clone, Debug, Ord, Hash, Eq, PartialOrd, PartialEq)]
pub struct StoreHandle(Uuid);
impl StoreHandle {
pub fn new() -> StoreHandle {
StoreHandle(Uuid::new_v4())
}
}
lazy_static! {
pub static ref RUBY_STORE_CACHE: Arc<Mutex<BTreeMap<StoreHandle, Store>>> = {
Arc::new(Mutex::new(BTreeMap::new()))