summaryrefslogtreecommitdiff
path: root/src/collection.rs
diff options
context:
space:
mode:
authorMica White <botahamec@outlook.com>2024-03-14 17:21:51 -0400
committerMica White <botahamec@outlook.com>2024-03-14 17:21:51 -0400
commitad76d43dc28b8802d64eb7ddcd9e02d3d12ac89a (patch)
tree7c804518ef4368ebd87172f42bf25d0c18fc4e07 /src/collection.rs
parent7bd236853ef5ae705328c8fdc492cf60fc6887c1 (diff)
Implement sequenced collections
Diffstat (limited to 'src/collection.rs')
-rw-r--r--src/collection.rs18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/collection.rs b/src/collection.rs
index 1c276a6..93adf16 100644
--- a/src/collection.rs
+++ b/src/collection.rs
@@ -1,13 +1,14 @@
-use std::marker::{PhantomData, PhantomPinned};
-use std::ptr::NonNull;
+use std::{marker::PhantomData, ptr::NonNull};
use crate::{
key::Keyable,
lockable::{Lock, Lockable},
};
-mod collection;
+mod boxed_collection;
mod guard;
+mod owned_collection;
+mod ref_collection;
pub struct OwnedLockCollection<L> {
data: L,
@@ -22,16 +23,7 @@ pub struct RefLockCollection<'a, L> {
data: &'a L,
}
-pub struct BoxedLockCollection<L: 'static>(RefLockCollection<'static, L>);
-
-pub struct PinnedLockCollection<L> {
- _unpin: PhantomPinned,
- data: L,
- locks: Vec<NonNull<dyn Lock>>,
-}
-
-unsafe impl<L: Send> Send for PinnedLockCollection<L> {}
-unsafe impl<L: Sync> Sync for PinnedLockCollection<L> {}
+pub struct BoxedLockCollection<'a, L>(RefLockCollection<'a, L>);
/// A RAII guard for a generic [`Lockable`] type.
pub struct LockGuard<'a, 'key: 'a, L: Lockable<'a>, Key: Keyable + 'key> {