Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAlternative design for SizeLimit #160
Closed
Milestone
Comments
|
In particular, serializing with a bounded size is equivalent to checking bincode::serialized_size_bounded followed by serializing the thing normally, so that is already well supported. Deserializing with a bounded size is equivalent to deserializing from an io::Read that limits the number of bytes that you can read from it. Maybe consider providing such a reader in an external crate. let bounded = limit::reader(r, 50<<20);
bincode::deserialize_from(bounded) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It looks like the large majority of Bincode users on GitHub are using Infinite as the size limit. It would be nice to redesign the API to accommodate this use case more ergonomically.