Replies: 1 comment
-
There is nothing like that in the library so far. I haven't seen an API like that. Do you have an example? Pure curiosity. I have two questions regarding your example:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Maybe this is a bit niche, but I've seen it in a few APIs now. Instead of sending:
...to save space, an API might send:
But in Rust code you might still want to enforce the size of the array, so you have:
It would be nice if
serde_as(...)
could express this in the same way it can handle a vector of tuples. It might require const generics, but maybe I'm wrong about that. At the moment, the only workaround I can think of is to use vanilla Serde with something like:If this is already possible, excuse the spurious request, but it might make a nice next-level example in the docs?
Beta Was this translation helpful? Give feedback.
All reactions