Skip to content

feat: add to_value and from_value functions.#5

Open
zicklag wants to merge 1 commit into
n0-computer:mainfrom
zicklag:feat/to-from-value
Open

feat: add to_value and from_value functions.#5
zicklag wants to merge 1 commit into
n0-computer:mainfrom
zicklag:feat/to-from-value

Conversation

@zicklag

@zicklag zicklag commented Dec 13, 2025

Copy link
Copy Markdown
Contributor

Description

Adds to_value() and from_value() functions along with corresponding ValueSerializer and ValueDeserializer structs, which can be used to convert between a Rust struct that implements Serialize/Deserialize and a dasl::drisl::Value.

Breaking Changes

None

Notes & open questions

My use-case was wanting to have a Rust wrapper type that contained a DRISL Value in it and could be deserialized without needing to know the details of the inner type.

But then later I would need to take that Value and deserialize it into a specific Rust type. Letting you deserialize directly from the Value saves a round-trip through the CBOR encoding.

I added a couple small test-cases, but they are far from exhaustive.

Change checklist

  • Self-review.
  • Documentation updates following the style guide, if relevant.
  • Tests if relevant.
  • All breaking changes documented.

@b5

b5 commented Jan 15, 2026

Copy link
Copy Markdown
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

@zicklag zicklag force-pushed the feat/to-from-value branch from 19e76bf to f4aa01f Compare January 15, 2026 19:44
@zicklag zicklag force-pushed the feat/to-from-value branch from f4aa01f to 5651bab Compare January 15, 2026 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants