From 0a6bd8f2c0a7c79d17f5dc9e64af0b4c6c745166 Mon Sep 17 00:00:00 2001 From: Mica White Date: Wed, 26 Aug 2026 21:03:22 -0400 Subject: Comments --- src/context/iterator.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/context/iterator.rs') diff --git a/src/context/iterator.rs b/src/context/iterator.rs index cc3bd7c..1eacaea 100644 --- a/src/context/iterator.rs +++ b/src/context/iterator.rs @@ -315,6 +315,7 @@ impl<'c, L: 'c + Iterator, I: 'c + RawLock + Lockable, O> LockingI /// let last = iter.lock_last().unwrap(); /// assert_eq!(**last, 8); /// ``` + // I'm honestly not sure why anyone would use this pub fn lock_last(self) -> Option::Guard<'c>, ThreadKey>> { self.iterator.last().map(|lock| unsafe { lock.raw_write(); @@ -542,6 +543,12 @@ impl<'c, L: 'c + Iterator, I: 'c + RawLock + Sharable, O> } } +// Most of these methods are wrappers around Iterator methods. I didn't +// implement all of them. Some of them don't make sense for this type of +// collection, like rposition. Many iterator methods also take closures, and I +// wasn't sure if people would want a reference to the lock or the value inside +// the lock. In retrospect, we can't actually allow people to see references to +// the locks, so maybe we should just settle for values inside locks. impl<'l, L: Iterator, O> LockingIterator<'l, L, O> { /// Advances the iterator, without locking the next element in the iterator. /// -- cgit v1.3.1