From 14002e05a6ef08b53701d81e26373b221b68ee02 Mon Sep 17 00:00:00 2001 From: Pierre Avital Date: Thu, 29 Feb 2024 14:18:57 +0100 Subject: [PATCH] document the owned sample type itself --- include/zenoh_commons.h | 6 ++++++ src/commons.rs | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index de58c7bf8..6039a2bd5 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -839,6 +839,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; diff --git a/src/commons.rs b/src/commons.rs index 085a0df5a..555a380be 100644 --- a/src/commons.rs +++ b/src/commons.rs @@ -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,