Open djkoloski opened 3 years ago
Here to register a use case. I am building a library that uses shared pointers under the hood to maintain a global reversible history of the state, and would like to support serializing and deserializing these data structures. This is not currently possible in rkyv
due to the lack of Cell
support, which is used to track the current version Rc<Cell<u64>>
or Arc<AtomicU64>
.
Just mentioned this in one of our issues. We have a Merkle tree implementation that lazily computes the root. The data in the nodes of the tree is behind a RefCell
, as such serializing this tree wholesale is not possible currently.
Supporting Cell
and RefCell
requires adding some more complexity to rkyv's trait system. Because &[u8]
can be accessed as an archived type, we have to require that there are no types with interior mutability in that case. That requirement can be relaxed when accessing &mut [u8]
, but it remains to be seen how much of an ergonomics impact that would have.
I made a genuine effort to support interior mutability as a first-class citizen, but ran into some problems that can't be fixed. See #527 for details.
Supporting these types will make it easier to support modifiable archived types and help exercise the mutable API for rkyv.
Before diving in on this one, let's try to get some concrete use cases down. We need to make sure wee have at least one happy user.