-
Notifications
You must be signed in to change notification settings - Fork 217
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
Allowing construction of NoAllocSliceSegments with buffer and NoAllocBufferSegmentType #488
Comments
What if we add public visibility to Then I think you would be able get the message length from |
In my case, I don't need to use BTW, is there a reason why NoAllocBufferSegmentType is defined as: enum NoAllocBufferSegmentType {
SingleSegment(usize, usize),
MultipleSegments,
} Instead of: enum NoAllocBufferSegmentType {
SingleSegment,
MultipleSegments,
} In the case of |
Hm... I agree that it looks like the first parameter is not needed. The second parameter however might point to before the end of the buffer if capnproto-rust/capnp/src/serialize/no_alloc_buffer_segments.rs Lines 160 to 163 in bcaac56
|
I removed the first parameter in 9738fed. |
I opened a PR for adding public visibility tot he relevant items: #489. |
@dwrensha Thanks for your prompt help. I really appreciate it! |
Closed by #489. |
It would be advantageous to enable the creation of NoAllocSliceSegments along with a buffer and NoAllocBufferSegmentType, particularly when the message has already undergone parsing. While this capability was present until version 0.17, it has since become unavailable, resulting in inefficiencies as parsing must be repeated during the construction of NoAllocSliceSegments.
The necessity for this functionality stems from the asynchronous reading of messages in the Cap'n Proto protocol format from sockets. In such scenarios, clients must parse the header (segments) to ascertain the message's length, thus obviating the need for re-parsing within NoAllocSliceSegments.
Is there any alternative approach available that can overcome this issue?
The text was updated successfully, but these errors were encountered: