diff --git a/zenoh/src/query.rs b/zenoh/src/query.rs index c4f3fb35e9..7a7c3c8ae0 100644 --- a/zenoh/src/query.rs +++ b/zenoh/src/query.rs @@ -306,6 +306,18 @@ impl<'a, 'b, Handler> GetBuilder<'a, 'b, Handler> { self } + /// Change the encoding of the query value. + #[inline] + pub fn encoding(mut self, encoding: IntoEncoding) -> Self + where + IntoEncoding: Into, + { + 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);