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
z_owned_payload_t is an opaque object which can be received as part of sample or reply (instead of pair (buffer,length) at this moment)
the access to data in the payload object is perfromed through reader interface, like in Rust. For c the interface is similar to file interface with read(), seek(), rewind(), etc. No direct access to memory is provided
the set of functions to decode payload into integer, string, double is provided. These functions corresponds to From<Payload> traits in rust
constructing new payload for sending was not discussed. It should be possible to construct playload from string, integer, double as in Into<Payload> traits in rust. The way to construct payload from arbirtary user data should be provided also. To be decided, how. Write interface for symmetry? Just construct from user-owned buffer? Allocate single zenoh-owned buffer? All these variants?
It's unclear how z_put() should accept payload object: by taking ownership or by loaning? Accepting it with taking ownership (with z_move) is more convenient, no need to additional drop. But in this case for sending same payload for multiple destinations the payload should support clone operation (rcinc). Should the payload support it?
The text was updated successfully, but these errors were encountered:
Additional point: encoder/decoders should be also applicable to values of the attachment. Though this is related to discussion about attachment interface and should be started from Rust. Issue to be created
After discussion which started with @kydos and continued with @Mallets, @DenisBiryukov91. @sashacmc , @milyin the following decisions were made about new payload API for zenoh-c
z_owned_payload_t
is an opaque object which can be received as part of sample or reply (instead of pair (buffer,length) at this moment)read()
,seek()
,rewind()
, etc. No direct access to memory is providedFrom<Payload>
traits in rustInto<Payload>
traits in rust. The way to construct payload from arbirtary user data should be provided also. To be decided, how. Write interface for symmetry? Just construct from user-owned buffer? Allocate single zenoh-owned buffer? All these variants?z_put()
should accept payload object: by taking ownership or by loaning? Accepting it with taking ownership (withz_move
) is more convenient, no need to additional drop. But in this case for sending same payload for multiple destinations the payload should support clone operation (rcinc). Should the payload support it?The text was updated successfully, but these errors were encountered: