-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add size_hint for Bincoded #16
Conversation
89fb8c8
to
89a2aab
Compare
|
Hmm... so I'm trying to allocate an I/O buffer up-front (not a Vec, not resizable) that will contain the serialized output. The serialized type has a Bincoded type. How do I figure out the size of the I/O buffer to allocate? |
Using this |
In general, when doing I/O you probably want to allocate buffer once and reuse it each time you send a message. |
I'm using glommio so there's not really any opportunity to manually reuse buffers - it has its own pool. Nor would it make sense to hang onto them for my use-case. |
It's actually the same thing. Except that lib is keeping the buffer. |
So I'm still struggling to get Bincoded / SerializeRef working properly. Here's my code snippet: Fails with this error If I omit the SerializeRef derivation, it fails with:
|
#17 should help |
Thanks! |
Also fixes issue #14