Pscheidl/treesome

Optional serde for BTree

Pscheidl opened this issue · 1 comments

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:

  1. Explicit code duplication with traits and tests ensuring the implemntation is the same, extracting logic to the module and #[inline] it. (not preferred).
  2. Macros with conditional compilation, using different header for each.
  3. Wait for specialization sepecialization

Implemented for constant-sized trees.