simd-json-derive
simd-json-derive copied to clipboard
Ability to skip over _ prefixed fields
How big of a task is it to skip over these fields when deriving Serialize?
Ex:
struct Ye {
a: u16,
_b: u8,
c: u32,
}
should produce
{ "Ye":
{
"a": 0,
"c": 0
}
}
I don't think it's a big task, but I'm not convinced we should do it. People might very well expect them to be included, especially since serde includes them as well.
Perhaps a better alternative would be to support the skip attribute? (which too isn't a big one I think)
adding skip in here https://github.com/simd-lite/simd-json-derive/blob/0bca4d4e336667a82469574e684bd3d97e09fbe4/simd-json-derive-int/src/args.rs#L16 should be rather stright forward :) we already have the much more complex skip_serializing_if