Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add trait to get binary size of messages #307

Open
wucke13 opened this issue Jan 7, 2023 · 1 comment
Open

Add trait to get binary size of messages #307

wucke13 opened this issue Jan 7, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@wucke13
Copy link

wucke13 commented Jan 7, 2023

If a message contains only known size types (e.g. arrays and primitives, but no Vec etc.) it would be cool to have a const helper function that determines the size of a buffer that is guaranteed to fit the serialized message. This greatly improves the usability in environments without alloc.

@sempervictus
Copy link

Finding this to be somewhat necessary rather than a convenience when using typed enums getting their type from outside their own byte range (typed body getting type passed as ctx from the header) - can't convert those to bytes for measurement conveniently and need to edit them destructured which then has to update the header length.

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

No branches or pull requests

3 participants