diff options
| author | Botahamec <botahamec@outlook.com> | 2024-05-21 19:17:11 -0400 |
|---|---|---|
| committer | Botahamec <botahamec@outlook.com> | 2024-05-21 19:17:11 -0400 |
| commit | 86610b631c20832d160c1a38181080232a05b508 (patch) | |
| tree | d10eaefdf7ecaa6add29c87ed4be77e231b8bfd1 /src/collection.rs | |
| parent | cf49f2900fe3c7abd1bbadacfdc745d6b5bbc235 (diff) | |
Sharable API
Diffstat (limited to 'src/collection.rs')
| -rw-r--r-- | src/collection.rs | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/collection.rs b/src/collection.rs index a11d60c..6623c8a 100644 --- a/src/collection.rs +++ b/src/collection.rs @@ -1,15 +1,12 @@ use std::marker::PhantomData; -use crate::{ - key::Keyable, - lockable::{Lock, Lockable}, -}; +use crate::{key::Keyable, lockable::Lock}; -mod boxed_collection; +mod boxed; mod guard; -mod owned_collection; -mod ref_collection; -mod retry_collection; +mod owned; +mod r#ref; +mod retry; pub struct OwnedLockCollection<L> { data: L, @@ -24,15 +21,15 @@ pub struct RefLockCollection<'a, L> { data: &'a L, } -pub struct BoxedLockCollection<'a, L>(RefLockCollection<'a, L>); +pub struct BoxedLockCollection<'a, L: 'a>(RefLockCollection<'a, L>); pub struct RetryingLockCollection<L> { data: L, } /// A RAII guard for a generic [`Lockable`] type. -pub struct LockGuard<'g, 'key: 'g, L: Lockable + 'g, Key: Keyable + 'key> { - guard: L::Guard<'g>, +pub struct LockGuard<'key, Guard, Key: Keyable + 'key> { + guard: Guard, key: Key, _phantom: PhantomData<&'key ()>, } |
