Hi,
i have a message to send in the form of:
type PubKey = Vec<u8>;
#[derive(Serialize, Deserialize, Debug)]
#[serde(tag="kind")]
pub enum Envelope<T> {
Greeting {
#[serde(with="serde_bytes")]
id: PubKey,
#[serde(with="serde_bytes")]
shared: PubKey,
thin: bool
},
AllKnown {
all_known: Vec<PubKey>
},
}
As you can see, PubKey is only a Vec<u8>, what is the most idiomatic way to pack this. I do not want to put the Vec<u8> in a struct to use serde_bytes.
Is there something i am missing?
It would be really neat to annotated all_known just with #[serde(with="serde_bytes")].
It seems a pretty common problem to be to have an array of byte arrays.
Hi,
i have a message to send in the form of:
As you can see,
PubKeyis only aVec<u8>, what is the most idiomatic way to pack this. I do not want to put theVec<u8>in a struct to useserde_bytes.Is there something i am missing?
It would be really neat to annotated
all_knownjust with#[serde(with="serde_bytes")].It seems a pretty common problem to be to have an array of byte arrays.