diff options
| author | Mica White <botahamec@outlook.com> | 2025-12-08 20:03:40 -0500 |
|---|---|---|
| committer | Mica White <botahamec@outlook.com> | 2025-12-08 20:03:40 -0500 |
| commit | 8be852662a432d96553fcf7a9fc57c4f3c92baae (patch) | |
| tree | 90c93f4d9d24538c64c7552a83ef8ae29172e78a /src/collection/owned.rs | |
| parent | 17dab88a7b4bc86cf156a1e0ac1bac19e6f9f5c6 (diff) | |
Stuff
Diffstat (limited to 'src/collection/owned.rs')
| -rwxr-xr-x[-rw-r--r--] | src/collection/owned.rs | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/collection/owned.rs b/src/collection/owned.rs index 38e6a16..d6889d1 100644..100755 --- a/src/collection/owned.rs +++ b/src/collection/owned.rs @@ -189,14 +189,18 @@ impl<L: OwnedLockable> OwnedLockCollection<L> { Self { data } } - pub fn scoped_lock<'a, R>(&'a self, key: impl Keyable, f: impl Fn(L::DataMut<'a>) -> R) -> R { + pub fn scoped_lock<'a, R>( + &'a self, + key: impl Keyable, + f: impl FnOnce(L::DataMut<'a>) -> R, + ) -> R { scoped_write(self, key, f) } pub fn scoped_try_lock<'a, Key: Keyable, R>( &'a self, key: Key, - f: impl Fn(L::DataMut<'a>) -> R, + f: impl FnOnce(L::DataMut<'a>) -> R, ) -> Result<R, Key> { scoped_try_write(self, key, f) } @@ -304,14 +308,18 @@ impl<L: OwnedLockable> OwnedLockCollection<L> { } impl<L: Sharable> OwnedLockCollection<L> { - pub fn scoped_read<'a, R>(&'a self, key: impl Keyable, f: impl Fn(L::DataRef<'a>) -> R) -> R { + pub fn scoped_read<'a, R>( + &'a self, + key: impl Keyable, + f: impl FnOnce(L::DataRef<'a>) -> R, + ) -> R { scoped_read(self, key, f) } pub fn scoped_try_read<'a, Key: Keyable, R>( &'a self, key: Key, - f: impl Fn(L::DataRef<'a>) -> R, + f: impl FnOnce(L::DataRef<'a>) -> R, ) -> Result<R, Key> { scoped_try_read(self, key, f) } |
