I'm trying to write a deserializer using serde for a binary format where a null value is encoded into the type value in some cases but i'm struggling to figure out any way of doing this. I have no flexibility on changing the binary format. Apologies i have no sample code as I'm perplexed on how to do this. Any tips or example deserializers I can learn from would be appreciated.
# Sample format
i16 -> null value = i16::MIN
i32 -> null value = i32::MIN
...
etc.
e.g. If the value is equal to i16::MIN, then return None, else Some(v)
Not supported nulls:
bool
i8/u8
Sequences
Strings
Maps