Skip to content

Does serde_with support post processor, or there is another way to do this? #796

Closed Answered by jonasbb
Magicloud asked this question in Q&A
Discussion options

You must be logged in to vote

I think your use case is covered by DefaultOnNull.

A general post-processing like this is not really feasible outside serde_derive. Functions are not generic types, so you cannot have a PostProcess<unwrap_or_default> or similar.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Magicloud
Comment options

Answer selected by Magicloud
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants