pub struct MqttCodec {
pub protocol_level: ProtocolLevel,
pub max_packet_size: Option<usize>,
}Fields§
§protocol_level: ProtocolLevelTracks the protocol level negotiated during CONNECT. Defaults to V311 for the first packet.
max_packet_size: Option<usize>Maximum allowed remaining length (bytes) for any MQTT packet.
None = no limit (backward-compatible default).
When exceeded, decode() returns MqttError::PayloadTooLarge
before allocating memory for the packet body.
Implementations§
Trait Implementations§
Source§impl Decoder for MqttCodec
impl Decoder for MqttCodec
Source§type Item = MqttPacket
type Item = MqttPacket
The type of decoded frames.
Source§fn decode(
&mut self,
src: &mut BytesMut,
) -> Result<Option<Self::Item>, Self::Error>
fn decode( &mut self, src: &mut BytesMut, ) -> Result<Option<Self::Item>, Self::Error>
Attempts to decode a frame from the provided buffer of bytes. Read more
Auto Trait Implementations§
impl Freeze for MqttCodec
impl RefUnwindSafe for MqttCodec
impl Send for MqttCodec
impl Sync for MqttCodec
impl Unpin for MqttCodec
impl UnsafeUnpin for MqttCodec
impl UnwindSafe for MqttCodec
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