feat: add to_value and from_value functions.#5
Open
zicklag wants to merge 1 commit into
Open
Conversation
Member
|
@zicklag thanks for this! can you take a look at the CI failures? would love to review once we're green, or help debug as needed. Taking a look at the failures it looks like pretty basic stuff |
19e76bf to
f4aa01f
Compare
f4aa01f to
5651bab
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds
to_value()andfrom_value()functions along with correspondingValueSerializerandValueDeserializerstructs, which can be used to convert between a Rust struct that implementsSerialize/Deserializeand adasl::drisl::Value.Breaking Changes
None
Notes & open questions
My use-case was wanting to have a Rust wrapper type that contained a DRISL
Valuein it and could be deserialized without needing to know the details of the inner type.But then later I would need to take that
Valueand deserialize it into a specific Rust type. Letting you deserialize directly from theValuesaves a round-trip through the CBOR encoding.I added a couple small test-cases, but they are far from exhaustive.
Change checklist