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