pub enum Packet {
Show 15 variants
Auth(Auth),
Connect(Connect, Option<LastWill>, ConnectAuth),
ConnAck(ConnAck),
Publish(Publish),
PubAck(PubAck),
PingReq(PingReq),
PingResp(PingResp),
Subscribe(Subscribe),
SubAck(SubAck),
PubRec(PubRec),
PubRel(PubRel),
PubComp(PubComp),
Unsubscribe(Unsubscribe),
UnsubAck(UnsubAck),
Disconnect(Disconnect),
}Variants§
Auth(Auth)
Connect(Connect, Option<LastWill>, ConnectAuth)
ConnAck(ConnAck)
Publish(Publish)
PubAck(PubAck)
PingReq(PingReq)
PingResp(PingResp)
Subscribe(Subscribe)
SubAck(SubAck)
PubRec(PubRec)
PubRel(PubRel)
PubComp(PubComp)
Unsubscribe(Unsubscribe)
UnsubAck(UnsubAck)
Disconnect(Disconnect)
Implementations§
Source§impl Packet
impl Packet
Sourcepub fn read(
stream: &mut BytesMut,
max_size: Option<u32>,
) -> Result<Packet, Error>
pub fn read( stream: &mut BytesMut, max_size: Option<u32>, ) -> Result<Packet, Error>
Reads the next MQTT v5 packet from the buffered stream.
§Errors
Returns an error if the packet is incomplete, malformed, or exceeds the configured packet-size limit.
Sourcepub fn write(
&self,
write: &mut BytesMut,
max_size: Option<u32>,
) -> Result<usize, Error>
pub fn write( &self, write: &mut BytesMut, max_size: Option<u32>, ) -> Result<usize, Error>
Serializes this MQTT v5 packet into the output buffer.
§Errors
Returns an error if the packet cannot be encoded within the configured packet-size limit or violates MQTT encoding rules.
pub fn size(&self) -> usize
Trait Implementations§
impl Eq for Packet
impl StructuralPartialEq for Packet
Auto Trait Implementations§
impl !Freeze for Packet
impl RefUnwindSafe for Packet
impl Send for Packet
impl Sync for Packet
impl Unpin for Packet
impl UnsafeUnpin for Packet
impl UnwindSafe for Packet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more