Thanks for making this crate! I had some trouble getting RwLock<Vec<RwLock<T>> to work in a hobby project I have and thought I would contribute back the helper functions I came up with.
The reason I would like something like this merged into the crate is so that consumers don't have to write unsafe code to use OwningHandle::new_with_fn with RwLock<T> or Mutex<T>.
I'm not sure where to put these functions, but I'm guessing where they are is not the right place or with the right ergonomics. 😅
I've linked the PR. It needs some more work and love 😊 but would like to confirm if this is a direction you'd like to go before I invest more time in it.
Thanks for making this crate! I had some trouble getting
RwLock<Vec<RwLock<T>>
to work in a hobby project I have and thought I would contribute back the helper functions I came up with.The reason I would like something like this merged into the crate is so that consumers don't have to write unsafe code to use
OwningHandle::new_with_fn
withRwLock<T>
orMutex<T>
.I'm not sure where to put these functions, but I'm guessing where they are is not the right place or with the right ergonomics. 😅