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

Measure trait and dynamic buffers #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jac3km4
Copy link

@jac3km4 jac3km4 commented Feb 10, 2024

Another PR with some of my changes.
This aims to make the TryWrite trait more convenient to use by adding an alloc feature, that enables the user to convert values directly into bytes.
The way this is achieved is by adding a new Measure trait that can calculate the required size of the buffer for a value. This is used in a new IntoBytesExt extension trait, which is feature-gated behind alloc - it allocates a new Vec and writes the value into it.

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

Successfully merging this pull request may close these issues.

1 participant