Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

How to conveniently work with binaries as vectors of bytes? #551

Closed
radrow opened this issue Jun 27, 2023 · 0 comments
Closed

How to conveniently work with binaries as vectors of bytes? #551

radrow opened this issue Jun 27, 2023 · 0 comments

Comments

@radrow
Copy link

radrow commented Jun 27, 2023

In my project I extensively use various byte arrays (Vec<u8>, [u8]). I have quite a number of types which comprise those as fields.

My problem is, ruslter converts those to Erlang lists, and I don't like for obvious reasons. This leaves me to these workarounds:

  1. Implement almost all decoders/encoders by hand
  2. Wrap all byte arrays with a newtype
  3. Cry

The problem with 1 is that it's quite a tedious work. It also adds maintenance burden. Normally I would use a derive macro, but it automatically picks lists. I know the current way to go is 2, but I don't want to pollute entire code with a custom wrapper for a byte array for this one sole purpose. My project is not Erlang-first oriented. Regarding 3, I am out of tears already.

Is there any better way around it? If not, could this be a feature request?

@rusterlium rusterlium locked and limited conversation to collaborators Jun 27, 2023
@filmor filmor converted this issue into discussion #553 Jun 27, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant