From bf53c6b5294223829975a4795482da9e77c1a19e Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sun, 22 Jan 2017 15:15:02 +0100 Subject: [PATCH] Add StoreHandle::new() --- libimagruby/src/cache.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libimagruby/src/cache.rs b/libimagruby/src/cache.rs index 902c0545..94c2b869 100644 --- a/libimagruby/src/cache.rs +++ b/libimagruby/src/cache.rs @@ -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>> = { Arc::new(Mutex::new(BTreeMap::new()))