summaryrefslogtreecommitdiff
path: root/src/iterator.rs
diff options
context:
space:
mode:
authorMica White <botahamec@outlook.com>2026-08-16 12:43:05 -0400
committerMica White <botahamec@outlook.com>2026-08-16 12:43:05 -0400
commit6f6e030ea7edb9d155ebf21b5d42936c20801b50 (patch)
treef201f6536e3cb21786dc037570fba3f3ed2ff0e7 /src/iterator.rs
parent482b47f4ed786946acb324b60d9f7ae7dd8cc075 (diff)
Implement LockContext
Diffstat (limited to 'src/iterator.rs')
-rw-r--r--src/iterator.rs29
1 files changed, 20 insertions, 9 deletions
diff --git a/src/iterator.rs b/src/iterator.rs
index 30b01e0..79a2cc5 100644
--- a/src/iterator.rs
+++ b/src/iterator.rs
@@ -1,18 +1,29 @@
-mod consumed_guard;
+use std::marker::PhantomData;
+
+use crate::ThreadKey;
+
+mod context;
mod guard;
mod iterator;
+mod tuple;
-pub struct LockingIterator<L, Key> {
- key: Key,
- lockable: L,
+pub struct LockingIterator<'context, I> {
+ key: &'context ThreadKey,
+ iterator: I,
}
-pub struct IteratorGuard<'a, Guard, Key> {
- _key: &'a Key,
- guard: Guard,
+pub struct LockingTuple<'context, L, C> {
+ _lockable: PhantomData<L>,
+ key: &'context ThreadKey,
+ tuple: &'context C,
}
-pub struct ConsumedIteratorGuard<Guard, Key> {
- key: Key,
+pub struct LockContext<'l, L> {
+ key: Option<ThreadKey>,
+ lockable: &'l L,
+}
+
+pub struct IteratorGuard<'a, Guard, Key> {
+ _key: &'a Key,
guard: Guard,
}