-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Working with more complex types is difficult #14
Comments
This seems like a question for the serde repository rather than the bytes repository I think? |
jonasbb
added a commit
to jonasbb/serde_with
that referenced
this issue
Mar 11, 2021
The `Bytes` type is heavily inspired by `serde_bytes` and ports it to the serde_as system. ```rust value: Vec<u8>, ``` Compared to `serde_bytes` these improvements are available 1. Integration with the `serde_as` annotation. /cc serde-rs/bytes#14 2. Implementation for arrays of arbitrary size (Rust 1.51+). /cc serde-rs/bytes#26
jonasbb
added a commit
to jonasbb/serde_with
that referenced
this issue
Mar 11, 2021
The `Bytes` type is heavily inspired by `serde_bytes` and ports it to the serde_as system. ```rust #[serde_as(as = "Bytes")] value: Vec<u8>, ``` Compared to `serde_bytes` these improvements are available 1. Integration with the `serde_as` annotation. /cc serde-rs/bytes#14 2. Implementation for arrays of arbitrary size (Rust 1.51+). /cc serde-rs/bytes#26
jonasbb
added a commit
to jonasbb/serde_with
that referenced
this issue
Mar 11, 2021
The `Bytes` type is heavily inspired by `serde_bytes` and ports it to the serde_as system. ```rust value: Vec<u8>, ``` Compared to `serde_bytes` these improvements are available 1. Integration with the `serde_as` annotation. /cc serde-rs/bytes#14 2. Implementation for arrays of arbitrary size (Rust 1.51+). /cc serde-rs/bytes#26
jonasbb
added a commit
to jonasbb/serde_with
that referenced
this issue
Mar 12, 2021
The `Bytes` type is heavily inspired by `serde_bytes` and ports it to the serde_as system. ```rust value: Vec<u8>, ``` Compared to `serde_bytes` these improvements are available 1. Integration with the `serde_as` annotation. /cc serde-rs/bytes#14 2. Implementation for arrays of arbitrary size (Rust 1.51+). /cc serde-rs/bytes#26
bors bot
added a commit
to jonasbb/serde_with
that referenced
this issue
Mar 12, 2021
277: Add a `Bytes` type for more efficient byte sequences r=jonasbb a=jonasbb The `Bytes` type is heavily inspired by `serde_bytes` and ports it to the serde_as system. ```rust #[serde_as(as = "Bytes")] value: Vec<u8>, ``` Compared to `serde_bytes` these improvements are available 1. Integration with the `serde_as` annotation. /cc serde-rs/bytes#14 2. Implementation for arrays of arbitrary size (Rust 1.51+). /cc serde-rs/bytes#26 Co-authored-by: Jonas Bushart <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to make some structures serialize into bytes in a nice way. However, these types contain both optional data and maps of bytes (
Option<Vec<u8>>
andBTreeMap<usize, Vec<u8>>
).#[serde(with = "serde_bytes")]
doesn't seem capable of dealing with these types. I've found a way to make them work by changing the types toOption<ByteBuf>
andBTreeMap<usize, ByteBuf>
, but it adds quite a lot of extra glue code. Is there a nicer way to achieve this?The text was updated successfully, but these errors were encountered: