You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My question is: what should be the value of the buffer? Isn't it always the encoded_len of the same message? If so, why is the buffer parameter needed?
The text was updated successfully, but these errors were encountered:
The reason that you can specify it, is because you may be encoding this into part of an existing buffer. That said, through #378 you would have the most common case of prost doing the allocation for you, for a single message.
Is https://docs.rs/prost/0.7.0/prost/trait.Message.html#method.encode the general way to encode messages? It takes a buffer. A quick look in:
both use the encoded_len of the message for the capacity of the buffer. https://hockeybuggy.com/blog/post/2020/01/experimenting-with-protobufs-generated-types-in-rust uses just a value of 200 'to be sure'. That looks a little bit odd to me.
My question is: what should be the value of the buffer? Isn't it always the encoded_len of the same message? If so, why is the buffer parameter needed?
The text was updated successfully, but these errors were encountered: