summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Müller <neikos@neikos.email>2024-03-21 13:31:12 +0100
committerMarcel Müller <neikos@neikos.email>2024-03-21 13:31:12 +0100
commit5dd15e30321046bc0401e22a09112545bf731b18 (patch)
tree695c3911bc1ad01914c70805e54607fe40ec45b1
parent7816522bf52000a3e30cb0352146b1bc92555cd5 (diff)
Implement MPubrec::write
Signed-off-by: Marcel Müller <neikos@neikos.email>
-rw-r--r--mqtt-format/src/v5/packets/pubrec.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/mqtt-format/src/v5/packets/pubrec.rs b/mqtt-format/src/v5/packets/pubrec.rs
index 2d7c984..42a5428 100644
--- a/mqtt-format/src/v5/packets/pubrec.rs
+++ b/mqtt-format/src/v5/packets/pubrec.rs
@@ -10,6 +10,8 @@ use winnow::Parser;
use crate::v5::variable_header::PacketIdentifier;
use crate::v5::variable_header::ReasonString;
use crate::v5::variable_header::UserProperties;
+use crate::v5::write::WResult;
+use crate::v5::write::WriteMqttPacket;
use crate::v5::MResult;
crate::v5::reason_code::make_combined_reason_code! {
@@ -61,4 +63,10 @@ impl<'i> MPubrec<'i> {
})
.parse_next(input)
}
+
+ pub async fn write<W: WriteMqttPacket>(&self, buffer: &mut W) -> WResult<W> {
+ self.packet_identifier.write(buffer).await?;
+ self.reason.write(buffer).await?;
+ self.properties.write(buffer).await
+ }
}