Enum mqttrust_core::encoding::v4::Error[][src]

pub enum Error {
    WriteZero,
    InvalidPid(u16),
    InvalidQos(u8),
    InvalidConnectReturnCode(u8),
    InvalidProtocol(String<10_usize>, u8),
    InvalidHeader,
    InvalidLength,
    InvalidString,
}
Expand description

Errors returned by encode() and decode().

Variants

WriteZero

Not enough space in the write buffer.

It is the caller’s responsiblity to pass a big enough buffer to encode().

InvalidPid(u16)

Tried to encode or decode a ProcessIdentifier==0.

Tuple Fields of InvalidPid

0: u16
InvalidQos(u8)

Tried to decode a QoS > 2.

Tuple Fields of InvalidQos

0: u8
InvalidConnectReturnCode(u8)

Tried to decode a ConnectReturnCode > 5.

Tuple Fields of InvalidConnectReturnCode

0: u8
InvalidProtocol(String<10_usize>, u8)

Tried to decode an unknown protocol.

Tuple Fields of InvalidProtocol

0: String<10_usize>1: u8
InvalidHeader

Tried to decode an invalid fixed header (packet type, flags, or remaining_length).

InvalidLength

Trying to encode/decode an invalid length.

The difference with WriteZero/UnexpectedEof is that it refers to an invalid/corrupt length rather than a buffer size issue.

InvalidString

Trying to decode a non-utf8 string.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.