Skip to content

Conversation

nathan-at-least
Copy link

@nathan-at-least nathan-at-least commented May 8, 2023

This adds an example for a useful pattern where a type needs to be validated arbitrarily (via TryFrom on an inner type) during deserialization. This comes directly from serde-rs/serde#642 (comment) where I learned the pattern.

I couldn't figure out on my own how to do this via browsing https://serde.rs, so I went to the issue tracker where I found this recipe, so it seems like a good candidate for the examples section.

@cschramm
Copy link

cschramm commented Aug 1, 2023

I think this is pretty useful, but it might be worth mentioning serde-rs/serde#2178 as a limitation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants