Skip to content
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

Implement bincode Writer and Reader traits for Vec #519

Open
petekubiak opened this issue Nov 29, 2024 · 2 comments
Open

Implement bincode Writer and Reader traits for Vec #519

petekubiak opened this issue Nov 29, 2024 · 2 comments

Comments

@petekubiak
Copy link

I am working on a no_std embedded comms stack which talks to devices running C applications. The stack uses heapless::Vecs to handle the byte streams being sent and received, and I would like to use bincode to perform the conversion to / from Rust structures.

Right now, in order to do this I have to create a wrapper type around the heapless::Vec in order to implement bincode's Writer and Reader traits. It seems like this is a common enough pairing that it would make sense to have these traits implemented for heapless::Vec by default, or at least available through a feature, rather than having to re-implement for each new project working in this space.

I'm not sure whether it would make more sense for this implementation to live in the bincode crate or the heapless crate, so I've created an equivalent issue on the bincode repo. What do you think?

@sosthene-nitrokey
Copy link
Contributor

Might be relevant:

@petekubiak
Copy link
Author

Yeah agreed, to me it would seem like it would make more sense for the implementation to live in the serialiser's crate rather than the collection's crate. Good to know there's precedent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants