uazu / qcell

Statically-checked alternatives to RefCell and RwLock
Apache License 2.0
356 stars 22 forks source link

Add `rw_chain` #51

Open T0mstone opened 2 months ago

T0mstone commented 2 months ago

I basically implemented https://github.com/uazu/qcell/issues/46#issuecomment-1669598770 as well as I could.

The use of Vec makes this require the alloc feature; I could also imagine a similar API with a limit, using an array instead (it wouldn't even need to depend on arrayvec since the unused usizes could just be 0, which isn't a valid address anyway), but I'll leave that for the future (if anyone turns out to need it).

This is somewhat barebones with regards to polish - I've only written tests for TCell. Should I duplicate these for all the other flavors? Also, I haven't written any documentation yet. Let me know if you want to accept this, then I'll try to write some.