From b06c58cd931c24a504a010e8d5cd63c7bacca90e Mon Sep 17 00:00:00 2001 From: Darius Maitia Date: Fri, 24 May 2024 12:45:50 +0200 Subject: [PATCH] issue(encoding): adding `new` function to EncodingInternals --- zenoh/src/api/encoding.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/zenoh/src/api/encoding.rs b/zenoh/src/api/encoding.rs index 7a76b98aca..f63c339ba3 100644 --- a/zenoh/src/api/encoding.rs +++ b/zenoh/src/api/encoding.rs @@ -840,6 +840,8 @@ pub trait EncodingInternals { fn id(&self) -> u16; fn schema(&self) -> Option<&ZSlice>; + + fn new(id: u16, schema: Option) -> Self; } impl EncodingInternals for Encoding { @@ -850,6 +852,10 @@ impl EncodingInternals for Encoding { fn schema(&self) -> Option<&ZSlice> { self.0.schema.as_ref() } + + fn new(id: u16, schema: Option) -> Self { + Encoding(zenoh_protocol::core::Encoding { id, schema }) + } } // - Zenoh SHM