From eec6f7b200f6896e9954126ff9e2321e84b934df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=BCller?= Date: Mon, 25 Mar 2024 12:04:20 +0100 Subject: [PATCH] Add yokeable to packets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcel Müller --- mqtt-format/src/v5/packets/auth.rs | 1 + mqtt-format/src/v5/packets/connack.rs | 1 + mqtt-format/src/v5/packets/connect.rs | 1 + mqtt-format/src/v5/packets/disconnect.rs | 1 + mqtt-format/src/v5/packets/mod.rs | 1 + mqtt-format/src/v5/packets/pingreq.rs | 1 + mqtt-format/src/v5/packets/pingresp.rs | 1 + mqtt-format/src/v5/packets/puback.rs | 1 + mqtt-format/src/v5/packets/pubcomp.rs | 1 + mqtt-format/src/v5/packets/publish.rs | 1 + mqtt-format/src/v5/packets/pubrec.rs | 1 + mqtt-format/src/v5/packets/pubrel.rs | 1 + mqtt-format/src/v5/packets/suback.rs | 1 + mqtt-format/src/v5/packets/subscribe.rs | 1 + mqtt-format/src/v5/packets/unsuback.rs | 1 + mqtt-format/src/v5/packets/unsubscribe.rs | 1 + 16 files changed, 16 insertions(+) diff --git a/mqtt-format/src/v5/packets/auth.rs b/mqtt-format/src/v5/packets/auth.rs index 49bdfd14..f152086a 100644 --- a/mqtt-format/src/v5/packets/auth.rs +++ b/mqtt-format/src/v5/packets/auth.rs @@ -41,6 +41,7 @@ crate::v5::properties::define_properties! { } } +#[cfg_attr(feature = "yoke", derive(yoke::Yokeable))] #[derive(Debug, PartialEq)] #[doc = crate::v5::util::md_speclink!("_Toc3901217")] pub struct MAuth<'i> { diff --git a/mqtt-format/src/v5/packets/connack.rs b/mqtt-format/src/v5/packets/connack.rs index 7f214d4a..7a67c3ca 100644 --- a/mqtt-format/src/v5/packets/connack.rs +++ b/mqtt-format/src/v5/packets/connack.rs @@ -115,6 +115,7 @@ define_properties![ } ]; +#[cfg_attr(feature = "yoke", derive(yoke::Yokeable))] #[derive(Debug, PartialEq)] #[doc = crate::v5::util::md_speclink!("_Toc3901074")] pub struct MConnack<'i> { diff --git a/mqtt-format/src/v5/packets/connect.rs b/mqtt-format/src/v5/packets/connect.rs index 0dce4509..86931989 100644 --- a/mqtt-format/src/v5/packets/connect.rs +++ b/mqtt-format/src/v5/packets/connect.rs @@ -33,6 +33,7 @@ use crate::v5::write::WResult; use crate::v5::write::WriteMqttPacket; use crate::v5::MResult; +#[cfg_attr(feature = "yoke", derive(yoke::Yokeable))] #[derive(Debug, PartialEq)] pub struct MConnect<'i> { pub client_identifier: &'i str, diff --git a/mqtt-format/src/v5/packets/disconnect.rs b/mqtt-format/src/v5/packets/disconnect.rs index b0a65e30..376e99f7 100644 --- a/mqtt-format/src/v5/packets/disconnect.rs +++ b/mqtt-format/src/v5/packets/disconnect.rs @@ -69,6 +69,7 @@ define_properties! { } } +#[cfg_attr(feature = "yoke", derive(yoke::Yokeable))] #[derive(Debug, PartialEq)] #[doc = crate::v5::util::md_speclink!("_Toc3901205")] pub struct MDisconnect<'i> { diff --git a/mqtt-format/src/v5/packets/mod.rs b/mqtt-format/src/v5/packets/mod.rs index c9d1d899..8bb23458 100644 --- a/mqtt-format/src/v5/packets/mod.rs +++ b/mqtt-format/src/v5/packets/mod.rs @@ -47,6 +47,7 @@ pub mod subscribe; pub mod unsuback; pub mod unsubscribe; +#[cfg_attr(feature = "yoke", derive(yoke::Yokeable))] #[derive(Debug)] pub enum MqttPacket<'i> { Auth(MAuth<'i>), diff --git a/mqtt-format/src/v5/packets/pingreq.rs b/mqtt-format/src/v5/packets/pingreq.rs index e9b665e5..346b42cc 100644 --- a/mqtt-format/src/v5/packets/pingreq.rs +++ b/mqtt-format/src/v5/packets/pingreq.rs @@ -11,6 +11,7 @@ use crate::v5::write::WResult; use crate::v5::write::WriteMqttPacket; use crate::v5::MResult; +#[cfg_attr(feature = "yoke", derive(yoke::Yokeable))] #[derive(Debug, PartialEq)] #[doc = crate::v5::util::md_speclink!("_Toc3901195")] pub struct MPingreq; diff --git a/mqtt-format/src/v5/packets/pingresp.rs b/mqtt-format/src/v5/packets/pingresp.rs index 0e8f48a0..fcede20e 100644 --- a/mqtt-format/src/v5/packets/pingresp.rs +++ b/mqtt-format/src/v5/packets/pingresp.rs @@ -11,6 +11,7 @@ use crate::v5::write::WResult; use crate::v5::write::WriteMqttPacket; use crate::v5::MResult; +#[cfg_attr(feature = "yoke", derive(yoke::Yokeable))] #[derive(Debug, PartialEq)] #[doc = crate::v5::util::md_speclink!("_Toc3901200")] pub struct MPingresp; diff --git a/mqtt-format/src/v5/packets/puback.rs b/mqtt-format/src/v5/packets/puback.rs index e1527c25..d1f28d79 100644 --- a/mqtt-format/src/v5/packets/puback.rs +++ b/mqtt-format/src/v5/packets/puback.rs @@ -41,6 +41,7 @@ define_properties!( } ); +#[cfg_attr(feature = "yoke", derive(yoke::Yokeable))] #[derive(Debug, PartialEq)] #[doc = crate::v5::util::md_speclink!("_Toc3901121")] pub struct MPuback<'i> { diff --git a/mqtt-format/src/v5/packets/pubcomp.rs b/mqtt-format/src/v5/packets/pubcomp.rs index 34831c54..403b12e7 100644 --- a/mqtt-format/src/v5/packets/pubcomp.rs +++ b/mqtt-format/src/v5/packets/pubcomp.rs @@ -33,6 +33,7 @@ crate::v5::properties::define_properties! { } } +#[cfg_attr(feature = "yoke", derive(yoke::Yokeable))] #[derive(Debug, PartialEq)] #[doc = crate::v5::util::md_speclink!("_Toc3901151")] pub struct MPubcomp<'i> { diff --git a/mqtt-format/src/v5/packets/publish.rs b/mqtt-format/src/v5/packets/publish.rs index d8902ed6..e2ba1a32 100644 --- a/mqtt-format/src/v5/packets/publish.rs +++ b/mqtt-format/src/v5/packets/publish.rs @@ -24,6 +24,7 @@ use crate::v5::write::WResult; use crate::v5::write::WriteMqttPacket; use crate::v5::MResult; +#[cfg_attr(feature = "yoke", derive(yoke::Yokeable))] #[derive(Debug, PartialEq)] #[doc = crate::v5::util::md_speclink!("_Toc3901100")] pub struct MPublish<'i> { diff --git a/mqtt-format/src/v5/packets/pubrec.rs b/mqtt-format/src/v5/packets/pubrec.rs index b18afd57..c02f21ab 100644 --- a/mqtt-format/src/v5/packets/pubrec.rs +++ b/mqtt-format/src/v5/packets/pubrec.rs @@ -41,6 +41,7 @@ crate::v5::properties::define_properties![ } ]; +#[cfg_attr(feature = "yoke", derive(yoke::Yokeable))] #[derive(Debug, PartialEq)] #[doc = crate::v5::util::md_speclink!("_Toc3901131")] pub struct MPubrec<'i> { diff --git a/mqtt-format/src/v5/packets/pubrel.rs b/mqtt-format/src/v5/packets/pubrel.rs index 6ab40802..fb96068b 100644 --- a/mqtt-format/src/v5/packets/pubrel.rs +++ b/mqtt-format/src/v5/packets/pubrel.rs @@ -34,6 +34,7 @@ define_properties!( } ); +#[cfg_attr(feature = "yoke", derive(yoke::Yokeable))] #[derive(Debug, PartialEq)] #[doc = crate::v5::util::md_speclink!("_Toc3901141")] pub struct MPubrel<'i> { diff --git a/mqtt-format/src/v5/packets/suback.rs b/mqtt-format/src/v5/packets/suback.rs index c6843d4e..44329bf8 100644 --- a/mqtt-format/src/v5/packets/suback.rs +++ b/mqtt-format/src/v5/packets/suback.rs @@ -43,6 +43,7 @@ crate::v5::properties::define_properties! { } } +#[cfg_attr(feature = "yoke", derive(yoke::Yokeable))] #[derive(Debug, PartialEq)] #[doc = crate::v5::util::md_speclink!("_Toc3901171")] pub struct MSuback<'i> { diff --git a/mqtt-format/src/v5/packets/subscribe.rs b/mqtt-format/src/v5/packets/subscribe.rs index 52b38cf4..991d5213 100644 --- a/mqtt-format/src/v5/packets/subscribe.rs +++ b/mqtt-format/src/v5/packets/subscribe.rs @@ -184,6 +184,7 @@ impl<'i> Iterator for SubscriptionsIter<'i> { } } +#[cfg_attr(feature = "yoke", derive(yoke::Yokeable))] #[derive(Debug, PartialEq)] pub struct MSubscribe<'i> { pub packet_identifier: PacketIdentifier, diff --git a/mqtt-format/src/v5/packets/unsuback.rs b/mqtt-format/src/v5/packets/unsuback.rs index 6778f8b1..94f8a981 100644 --- a/mqtt-format/src/v5/packets/unsuback.rs +++ b/mqtt-format/src/v5/packets/unsuback.rs @@ -33,6 +33,7 @@ crate::v5::properties::define_properties! { } } +#[cfg_attr(feature = "yoke", derive(yoke::Yokeable))] #[derive(Debug, PartialEq)] #[doc = crate::v5::util::md_speclink!("_Toc3901187")] pub struct MUnsuback<'i> { diff --git a/mqtt-format/src/v5/packets/unsubscribe.rs b/mqtt-format/src/v5/packets/unsubscribe.rs index 2ac99298..eb608d42 100644 --- a/mqtt-format/src/v5/packets/unsubscribe.rs +++ b/mqtt-format/src/v5/packets/unsubscribe.rs @@ -121,6 +121,7 @@ impl<'i> Unsubscription<'i> { } } +#[cfg_attr(feature = "yoke", derive(yoke::Yokeable))] #[derive(Debug, PartialEq)] #[doc = crate::v5::util::md_speclink!("_Toc3901179")] pub struct MUnsubscribe<'i> {