diff options
| author | Mica White <botahamec@outlook.com> | 2026-03-07 15:53:50 -0600 |
|---|---|---|
| committer | Mica White <botahamec@outlook.com> | 2026-03-07 15:53:50 -0600 |
| commit | fbdfc775bd1642a469f8a3fa0aa9beb91ca760d6 (patch) | |
| tree | ed03623618c56dcc3e08d876fe39fb84ea60a905 /src/collection/owned.rs | |
| parent | d7e9207295b6e609e540c7376f9293d3ef5c2f33 (diff) | |
Create basic locking iterator
Diffstat (limited to 'src/collection/owned.rs')
| -rwxr-xr-x | src/collection/owned.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/collection/owned.rs b/src/collection/owned.rs index 456742b..2172b96 100755 --- a/src/collection/owned.rs +++ b/src/collection/owned.rs @@ -1,3 +1,4 @@ +use crate::iterator::LockingIterator; use crate::lockable::{ Lockable, LockableGetMut, LockableIntoInner, OwnedLockable, RawLock, Sharable, }; @@ -642,6 +643,15 @@ impl<L: LockableIntoInner> OwnedLockCollection<L> { } } +impl<L: OwnedLockable> OwnedLockCollection<L> +where + for<'a> &'a L: IntoIterator, +{ + pub fn locking_iter(&self, key: ThreadKey) -> LockingIterator<<&L as IntoIterator>::IntoIter> { + LockingIterator::new(key, (&self.child).into_iter()) + } +} + #[cfg(test)] mod tests { use super::*; |
