diff options
author | Marcel Müller <neikos@neikos.email> | 2024-03-21 13:30:17 +0100 |
---|---|---|
committer | Marcel Müller <neikos@neikos.email> | 2024-03-21 13:30:17 +0100 |
commit | 7816522bf52000a3e30cb0352146b1bc92555cd5 (patch) | |
tree | 5857b874209b2e52ee1650378ffcdd7409212b76 | |
parent | 271391d5224e985c4f81ea996a966a1c3d6561d4 (diff) |
Implement MPubrel::write
Signed-off-by: Marcel Müller <neikos@neikos.email>
-rw-r--r-- | mqtt-format/src/v5/packets/pubrel.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mqtt-format/src/v5/packets/pubrel.rs b/mqtt-format/src/v5/packets/pubrel.rs index aa8a799..99074f4 100644 --- a/mqtt-format/src/v5/packets/pubrel.rs +++ b/mqtt-format/src/v5/packets/pubrel.rs @@ -11,6 +11,8 @@ use crate::v5::properties::define_properties; 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! { @@ -63,4 +65,10 @@ impl<'i> MPubrel<'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 + } } |