-
Notifications
You must be signed in to change notification settings - Fork 89
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
feat: Serde Serialize and Deserialize traits for the RbTree in the ic-certified-map crate. #399
feat: Serde Serialize and Deserialize traits for the RbTree in the ic-certified-map crate. #399
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be implemented as a plain map serialization rather than encoding the full tree structure. Unlike the HashTree structure, the RbTree internal structure is not relevant to the user.
Hey, I replaced the 'static generic lifetime bounds on the RbTree impl blocks for a custom lifetime 't. |
and added a test |
Looks like the new canister import functionality is messing with the PR check: https://github.com/dfinity/cdk-rs/actions/runs/6156757139/job/16706101327?pr=399 |
Some binary formats like bincode need the size of the map known before serializing the map items. Added bincode serialization in the serde test.
Hey @adamspofford-dfinity, can you merge this? |
Thanks Adam @adamspofford-dfinity for the review and merge. My apologies for putting off addressing your feedback for a while there. Won't happen again. |
This change adds the CandidType, serde Serialize and Deserialize traits to the RbTree in the ic-certified-map crate.
Useful for serializing a canister's certified data during upgrades.
This PR changes the 'static generic lifetime bounds on the RbTree impl blocks and replaces it with a custom lifetime 't.
How Has This Been Tested?
library/ic-certified-map/src/rbtree/test.rs
Checklist: