Skip to content

Commit

Permalink
Able to set encoding to query value.
Browse files Browse the repository at this point in the history
Signed-off-by: ChenYing Kuo <[email protected]>
  • Loading branch information
evshary committed Jan 23, 2024
1 parent b669489 commit fe676b4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions zenoh/src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,18 @@ impl<'a, 'b, Handler> GetBuilder<'a, 'b, Handler> {
self
}

/// Change the encoding of the query value.
#[inline]
pub fn encoding<IntoEncoding>(mut self, encoding: IntoEncoding) -> Self
where
IntoEncoding: Into<Encoding>,
{
if let Some(ref mut value) = self.value {
value.encoding = encoding.into();
}
self
}

#[zenoh_macros::unstable]
pub fn with_attachment(mut self, attachment: Attachment) -> Self {
self.attachment = Some(attachment);
Expand Down

0 comments on commit fe676b4

Please sign in to comment.