From 6f6e030ea7edb9d155ebf21b5d42936c20801b50 Mon Sep 17 00:00:00 2001 From: Mica White Date: Sun, 16 Aug 2026 12:43:05 -0400 Subject: Implement LockContext --- src/iterator.rs | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'src/iterator.rs') 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 { - 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, + key: &'context ThreadKey, + tuple: &'context C, } -pub struct ConsumedIteratorGuard { - key: Key, +pub struct LockContext<'l, L> { + key: Option, + lockable: &'l L, +} + +pub struct IteratorGuard<'a, Guard, Key> { + _key: &'a Key, guard: Guard, } -- cgit v1.3.1