XuJiandong / serde_molecule

Implementation of Molecule using Serde.
MIT License
1 stars 0 forks source link

"dynvec_serde" cannot be used as `#[serde(serialize_with = "dynvec_serde")]` #16

Open ashuralyk opened 4 days ago

ashuralyk commented 4 days ago

sometimes we only use serde_molecule to do the serializing work, like deserialize with serde_json and serialize with moleulce then.

XuJiandong commented 2 days ago

You can write it with following:

#[derive(Serialize)]
struct StructWithDynVec {
    #[serde(serialize_with = "dynvec_serde::serialize")]
    pub v: Vec<Vec<u8>>,
}