Optional serde for BTree
Pscheidl opened this issue · 1 comments
Pscheidl commented
Opt-in serde feature. Tree nodes hold a generic value of T
, where T's bounds would have to be restricted to T: Serialize + Deserialize<'de>
. Not all users want this bound. Therefore, on serde
feature enabled, the structure's signatures and its implementation's signatures should change to contain this bound, replacing the old ones. Two ways to do this:
- Explicit code duplication with traits and tests ensuring the implemntation is the same, extracting logic to the module and #[inline] it. (not preferred).
- Macros with conditional compilation, using different header for each.
- Wait for specialization sepecialization
Pscheidl commented
Implemented for constant-sized trees.