Add FileLockEntry

This commit is contained in:
Marcel Müller 2016-01-16 18:25:48 +01:00
parent 5289547873
commit 52f70e5b71
No known key found for this signature in database
GPG key ID: DD4ED37D0CAC76E2

View file

@ -23,3 +23,31 @@ pub trait Store {
} }
pub struct FileLockEntry<'a, S: Store + 'a> {
store: &'a S,
entry: Entry
}
impl<'a, S: Store + 'a> FileLockEntry<'a, S > {
fn new(store: &'a S, entry: Entry) -> FileLockEntry<'a, S> {
FileLockEntry {
store: store,
entry: entry,
}
}
}
impl<'a, S: Store + 'a> ::std::ops::Deref for FileLockEntry<'a, S> {
type Target = Entry;
fn deref(&self) -> &Self::Target {
&self.entry
}
}
impl<'a, S: Store + 'a> ::std::ops::DerefMut for FileLockEntry<'a, S> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.entry
}
}