-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for encoding/decoding with bincode. #45
base: main
Are you sure you want to change the base?
Conversation
I'm willing to add this once there's a public release of |
Codecov ReportBase: 96.33% // Head: 95.56% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #45 +/- ##
==========================================
- Coverage 96.33% 95.56% -0.77%
==========================================
Files 7 8 +1
Lines 873 880 +7
==========================================
Hits 841 841
- Misses 32 39 +7
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
This should also be implemented for Substr, and needs tests. That said, I wouldn't blame you on waiting on this given my other comments. |
Sounds good to me, while we're waiting for v2, I will work on adding support for Substr + tests. |
Also added tests for bincode, bump bincode version to new RC.
I added tests and implement traits for Substr too. |
DBSP relies on bincode version 2.0.0-rc3, which was released at the end of March 2023. DBSP also uses arcstr and we want to serialize and deserialize `ArcStr`s with bincode. Unfortunately, arcstr doesn't support bincode 2.0 yet and won't until bincode 2.0 finally gets released[1], which could be a long time, so we have a patch in Cargo.toml to support that. We'd like to publish DBSP to crates.io[2], but we can't if it depends on patches, so it seems best to avoid them. This commit drops the patch and switches to using #[bincode(with_serde)] to serialize ArcStr fields. [1]: thomcc/arcstr#45 [2]: #14 Signed-off-by: Ben Pfaff <[email protected]> Fixes: #395
DBSP relies on bincode version 2.0.0-rc3, which was released at the end of March 2023. DBSP also uses arcstr and we want to serialize and deserialize `ArcStr`s with bincode. Unfortunately, arcstr doesn't support bincode 2.0 yet and won't until bincode 2.0 finally gets released[1], which could be a long time, so we have a patch in Cargo.toml to support that. We'd like to publish DBSP to crates.io[2], but we can't if it depends on patches, so it seems best to avoid them. This commit drops the patch and switches to using #[bincode(with_serde)] to serialize ArcStr fields. [1]: thomcc/arcstr#45 [2]: #14 Signed-off-by: Ben Pfaff <[email protected]> Fixes: #395
Update May 2024: Still blocked on v2.0 of bincode. |
This PR adds optional support for serialization of ArcStr with bincode (similar to how it already exists for serde).
This avoids external projects which use arcstr and bincode having to wrap the ArcStr type to implement bincode::Decode and bincode::Encode for it.