jamesmunns / postcard

A no_std + serde compatible message library for Rust
Apache License 2.0
930 stars 89 forks source link

Tracking issue: Unsupported `serde` attributes #125

Open jamesmunns opened 10 months ago

jamesmunns commented 10 months ago

CC:

How to handle this?

elrafoon commented 10 months ago

I'm going to investigate #122.

samtay commented 4 months ago

FYI I also have deserialization issues when using deserialize_with.

dns2utf8 commented 2 months ago

I made a PoC for the skipping: https://github.com/jamesmunns/postcard/pull/174

ManevilleF commented 1 month ago

It seems that #[serde(skip)] breaks deserialization, due to discriminant offset

pub enum MyEnum {
    A,
    #[serde(skip)]
    B,
    C,
    D,
}

In this case deserializing A would work. But not C. postcard would attempt to deserialize C as D