Open cisaacson opened 4 years ago
I don't think there is a way to currently serialize hibitset.
The optional serde patch I tried works fine, let me know if you would like a pull request.
To use it looks like this, super easy to use:
let serde_len = bincode::serialized_size(&set1).unwrap();
let set1_buf = bincode::serialize(&set1).unwrap();
let result_set1: BitSet = bincode::deserialize(&set1_buf).unwrap();
I wouldn't resist adding such feature, so if you want to create PR it would be appreciated.
We most likely want to have it under a feature flag so we wont incur unnecessary dependencies users of the library.
Exactly how I implemented it (as an optional feature) :) I will submit a PR when I have fully tested it.
The PR has been submitted, let me know if you need anything else.
Is there a way to serialize hibitset to bytes? I could implement Serde and use bincode, but wanted to know if there is an existing way to do this.
I tested adding optional serde to the source code and it works fine, if you like I can fork and submit a pull request.