tosc-rs / mgnp

MnemOS Global Networking Protocol
Creative Commons Attribution Share Alike 4.0 International
15 stars 1 forks source link

feat(tricky-pipe): add a sharable, erased SerBox #18

Closed hawkw closed 11 months ago

hawkw commented 11 months ago

This branch adds a new SerBox API to tricky-pipe. A serbox::Sharer is a memory cell that can be used to store a single serializable value, and hand out a type-erased reference that can be used to serialize the value. One Sharer can be used to share multiple type-erased values, but only one at a time.

Sharers may be constructed from heap-allocated or statically allocated SerBoxes, allowing the user to determine the allocation strategy.