Skip to content

Commit

Permalink
Implement MPuback::write
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Beyer <[email protected]>
  • Loading branch information
matthiasbeyer committed Mar 21, 2024
1 parent 33ad5d4 commit 8123c25
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mqtt-format/src/v5/packets/puback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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! {
Expand Down Expand Up @@ -70,4 +72,10 @@ impl<'i> MPuback<'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
}
}

0 comments on commit 8123c25

Please sign in to comment.