feat(ed255519): Introduce serde_bytes optional dependency#337
feat(ed255519): Introduce serde_bytes optional dependency#337tarcieri merged 1 commit intoRustCrypto:masterfrom connec:serde_bytes_support
serde_bytes optional dependency#337Conversation
|
In contrast to #338 this has the advantage of keeping the features orthogonal, so |
|
@connec I think overall I prefer this approach to one which introduces crate features which don't properly unify i.e. #338 It does introduce an extra dependency, but I'm okay with that given the provenance of that particular dependency (i.e. it's by |
|
I've pushed an update that removes the |
This allows consumers to opt-in to `serde_bytes` support by setting the
`serde_bytes` feature. This makes it convenient to optimise
(de)serialization for formats with efficient byte array encodings, e.g.
#[derive(serde::Deserialize, serde::Serialize)]
struct MySignature {
#[serde(with = "serde_bytes")]
signature: ed25519::Signature,
}
Without first-class support for `serde_bytes`, consumers would have to
write their own (de)serialization machinery for this common case.
|
Looks good, thank you! It might be good to add the example from the description to the rustdoc as well. |
|
Released in #340 |
This allows consumers to opt-in to
serde_bytessupport by setting thestd,serde, andserde_bytesfeatures. This makes it convenient tooptimise (de)serialization for formats with efficient byte array
encodings, e.g.
Without first-class support for
serde_bytes, consumers would have towrite their own (de)serialization machinery for this common case.