summaryrefslogtreecommitdiff
path: root/src/collection/guard.rs
diff options
context:
space:
mode:
authorMica White <botahamec@outlook.com>2024-03-10 20:21:00 -0400
committerMica White <botahamec@outlook.com>2024-03-10 20:21:00 -0400
commitfe67aa262f1b04fb6c38683d9221c3a2fafcc35a (patch)
tree91366e032219f5e29ff4ba993598ae581aefa829 /src/collection/guard.rs
parente8d25c9e6e7d5c3a5a14219fc77ea98760cef790 (diff)
Reorganization
Diffstat (limited to 'src/collection/guard.rs')
-rw-r--r--src/collection/guard.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/collection/guard.rs b/src/collection/guard.rs
new file mode 100644
index 0000000..110a935
--- /dev/null
+++ b/src/collection/guard.rs
@@ -0,0 +1,19 @@
+use std::ops::{Deref, DerefMut};
+
+use crate::{key::Keyable, Lockable};
+
+use super::LockGuard;
+
+impl<'a, 'key: 'a, L: Lockable<'a>, Key: Keyable> Deref for LockGuard<'a, 'key, L, Key> {
+ type Target = L::Output;
+
+ fn deref(&self) -> &Self::Target {
+ &self.guard
+ }
+}
+
+impl<'a, 'key: 'a, L: Lockable<'a>, Key: Keyable> DerefMut for LockGuard<'a, 'key, L, Key> {
+ fn deref_mut(&mut self) -> &mut Self::Target {
+ &mut self.guard
+ }
+}