Skip to content

Commit

Permalink
document the owned sample type itself
Browse files Browse the repository at this point in the history
  • Loading branch information
p-avital committed Feb 29, 2024
1 parent 3551d38 commit 7148d5b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/zenoh_commons.h
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,12 @@ typedef struct zc_owned_liveliness_get_options_t {
* functions, then the operation will fail (but the passed value will still be consumed).
*/
typedef struct z_owned_buffer_t zc_owned_payload_t;
/**
* An owned sample.
*
* This is a read only type that can only be constructed by cloning a `z_sample_t`.
* Like all owned types, its memory must be freed by passing a mutable reference to it to `zc_sample_drop`.
*/
typedef struct zc_owned_sample_t {
struct z_owned_keyexpr_t _0;
struct z_owned_buffer_t _1;
Expand Down
4 changes: 4 additions & 0 deletions src/commons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ pub extern "C" fn z_sample_attachment(sample: &z_sample_t) -> z_attachment_t {
}
}

/// An owned sample.
///
/// This is a read only type that can only be constructed by cloning a `z_sample_t`.
/// Like all owned types, its memory must be freed by passing a mutable reference to it to `zc_sample_drop`.
#[repr(C)]
pub struct zc_owned_sample_t {
_0: z_owned_keyexpr_t,
Expand Down

0 comments on commit 7148d5b

Please sign in to comment.