diff --git a/commons/zenoh-buffers/src/zslice.rs b/commons/zenoh-buffers/src/zslice.rs index e53e6f3334..65808f1cc2 100644 --- a/commons/zenoh-buffers/src/zslice.rs +++ b/commons/zenoh-buffers/src/zslice.rs @@ -76,12 +76,14 @@ impl ZSliceBuffer for [u8; N] { #[cfg(feature = "shared-memory")] #[derive(Copy, Clone, PartialEq, Eq)] #[repr(u8)] +// tags{rust.z_slice_kind} pub enum ZSliceKind { Raw = 0, ShmPtr = 1, } /// A clonable wrapper to a contiguous slice of bytes. +// tags{rust.z_slice} #[derive(Clone)] pub struct ZSlice { pub(crate) buf: Arc, @@ -92,6 +94,7 @@ pub struct ZSlice { } impl ZSlice { + // tags{rust.z_slice.make, api.buffer.create} pub fn make( buf: Arc, start: usize, diff --git a/commons/zenoh-protocol/src/core/encoding.rs b/commons/zenoh-protocol/src/core/encoding.rs index f202b8e79c..348aed16b2 100644 --- a/commons/zenoh-protocol/src/core/encoding.rs +++ b/commons/zenoh-protocol/src/core/encoding.rs @@ -49,6 +49,7 @@ mod consts { #[repr(u8)] #[derive(Clone, Copy, Debug, PartialEq, Eq)] +// tags{rust.encoding, api.options.encoding} pub enum KnownEncoding { Empty = 0, AppOctetStream = 1, @@ -106,6 +107,7 @@ impl AsRef for KnownEncoding { /// /// A zenoh encoding is a HTTP Mime type represented, for wire efficiency, /// as an integer prefix (that maps to a string) and a string suffix. +// tags{rust.encoding, api.encoding} #[derive(Clone, Debug, PartialEq, Eq)] pub enum Encoding { Exact(KnownEncoding), @@ -113,6 +115,7 @@ pub enum Encoding { } impl Encoding { + // tags{rust.encoding.new, api.encoding.create} pub fn new(prefix: u8, suffix: IntoCowStr) -> ZResult where IntoCowStr: Into> + AsRef, @@ -130,6 +133,7 @@ impl Encoding { } /// Sets the suffix of this encoding. + // tags{rust.encoding.with_suffix, api.encoding.suffix.set} pub fn with_suffix(self, suffix: IntoCowStr) -> ZResult where IntoCowStr: Into> + AsRef, @@ -149,6 +153,7 @@ impl Encoding { /// Returns `true`if the string representation of this encoding starts with /// the string representation of ther given encoding. + // tags{rust.encoding.starts_with, api.encoding.starts_with} pub fn starts_with(&self, with: T) -> bool where T: Into, @@ -157,12 +162,14 @@ impl Encoding { self.prefix() == with.prefix() && self.suffix().starts_with(with.suffix()) } + // tags{rust.encoding.prefix, api.encoding.prefix.get} pub const fn prefix(&self) -> &KnownEncoding { match self { Encoding::Exact(e) | Encoding::WithSuffix(e, _) => e, } } + // tags{rust.encoding.suffix, api.encoding.suffix.get} pub fn suffix(&self) -> &str { match self { Encoding::Exact(_) => "",