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

Make generated rust no_panic compatible #22

Open
hchataing opened this issue May 31, 2023 · 1 comment
Open

Make generated rust no_panic compatible #22

hchataing opened this issue May 31, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@hchataing
Copy link
Collaborator

No description provided.

@hchataing hchataing added the enhancement New feature or request label May 31, 2023
hchataing added a commit that referenced this issue Nov 12, 2023
Fixes #74

- add encode<T: BufMut>(&self, buf: &mut T)
  which encodes the packet or struct to an existing
  buffer (#74). encode is faillible, and is expected
  to return an error if an inconsistency is found
  (e.g. size or padding overflow)
- derive the implementation for encode_to_vec and
  encode_to_bytes from encode
- separate encoding and decoding error types
- remove panics related to packet encoding (#22)
hchataing added a commit that referenced this issue Nov 22, 2023
Fixes #74

- add encode<T: BufMut>(&self, buf: &mut T)
  which encodes the packet or struct to an existing
  buffer (#74). encode is faillible, and is expected
  to return an error if an inconsistency is found
  (e.g. size or padding overflow)
- derive the implementation for encode_to_vec and
  encode_to_bytes from encode
- separate encoding and decoding error types
- remove panics related to packet encoding (#22)
hchataing added a commit that referenced this issue Nov 22, 2023
Fixes #74

- add encode<T: BufMut>(&self, buf: &mut T)
  which encodes the packet or struct to an existing
  buffer (#74). encode is faillible, and is expected
  to return an error if an inconsistency is found
  (e.g. size or padding overflow)
- derive the implementation for encode_to_vec and
  encode_to_bytes from encode
- separate encoding and decoding error types
- remove panics related to packet encoding (#22)
@hchataing
Copy link
Collaborator Author

All panic!s have been removed from the generated code. unwrap() is still being used internally, but not for parsing errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant