serbia
Serde big arrays. An attribute macro to make (de)serializing big arrays painless, following a design proposed by dtolnay.
Why?
I saw the idea in request-for-implementation. Then I came up with the name.
The name was too good. I had to do it. Don't judge me.
Also: Serbia has some tasty food.
But what is it for?
Serde only implements Serialize/Deserialize for arrays of length up to 32. This is due to Rust's current limitation - we can't be generic over array length, so
an arbitrary upper limit was chosen and implementations were generated only up to it.
The crate provides a macro that generates all the code you need to (de)serialize arrays bigger than that.
Status
Under development, but functional. Let me know what's missing or broken!
Usage
Just slap #[serbia] on top of your type definition. Structs and enums both work!
use serbia;
You can use the #[serbia_bufsize( ... )] attribute to set a buffer size for
a field. This can be useful for type aliases. Constants work here!
const BUFSIZE: usize = 300;
type BigArray = ;