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
I'm not a Kafka expert, but looking at the various bits and pieces, it seems possible that the Message trait could provide a
fnpayload_mut(&mutself) -> Option<&mut[u8]>;
Looking at the RdKafka::Message docs, it looks like the payload() method returns a void* without a const modifier (unlike the key_ptr() method which is const void*). My C++ is not super-strong, but my sense is that this signature means that one can safely mutate the results of payload().
The motivation might be limited, but it saves a copy for me (Abomonation does deserialization using in-place pointer correction). If it is a no-brainer, then great! If it is weird and mysterious and scary, I can understand that too.
The text was updated successfully, but these errors were encountered:
There are currently no constraints to modifying the per-message key/payload as long as honouring the key/payload lengths, but this should be considered and implementation detail and there are no formal guarantees that this will continue to be the case in future versions.
In practice I don't see a reason why this would ever change though.
I'm not a Kafka expert, but looking at the various bits and pieces, it seems possible that the
Message
trait could provide aLooking at the RdKafka::Message docs, it looks like the
payload()
method returns avoid*
without aconst
modifier (unlike thekey_ptr()
method which isconst void*
). My C++ is not super-strong, but my sense is that this signature means that one can safely mutate the results ofpayload()
.The motivation might be limited, but it saves a copy for me (Abomonation does deserialization using in-place pointer correction). If it is a no-brainer, then great! If it is weird and mysterious and scary, I can understand that too.
The text was updated successfully, but these errors were encountered: