Skip to content

Commit

Permalink
Merge pull request #1051 from ZettaScaleLabs/issue/encoding_internals
Browse files Browse the repository at this point in the history
Adding `new` function to EncodingInternals
  • Loading branch information
milyin authored May 24, 2024
2 parents 959fb6e + b06c58c commit 6174356
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions zenoh/src/api/encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,8 @@ pub trait EncodingInternals {
fn id(&self) -> u16;

fn schema(&self) -> Option<&ZSlice>;

fn new(id: u16, schema: Option<ZSlice>) -> Self;
}

impl EncodingInternals for Encoding {
Expand All @@ -850,6 +852,10 @@ impl EncodingInternals for Encoding {
fn schema(&self) -> Option<&ZSlice> {
self.0.schema.as_ref()
}

fn new(id: u16, schema: Option<ZSlice>) -> Self {
Encoding(zenoh_protocol::core::Encoding { id, schema })
}
}

// - Zenoh SHM
Expand Down

0 comments on commit 6174356

Please sign in to comment.