pub enum ProtocolParseError {
    UnknownEvent(Option<u8>),
    DisabledControllerDataPackageType(ControllerDataPackageType),
    ButtonParseError(ButtonParseError),
    InvalidLength(usizeusize),
    InvalidCrc(u8u16),
    InvalidFloatSize(usize),
}
Expand description

Represents the different kinds of errors which can happen when the protocol is being parsed.

Variants

UnknownEvent(Option<u8>)

The message contained an event which is not known to the current implementation. This can mean that:

  • the message was malformed or
  • that a newer protocol version has been used or
  • that the event type has not been enabled as a feature.

DisabledControllerDataPackageType(ControllerDataPackageType)

The message contained an event which is known to the library but has not been selected as a feature and can thus not be parsed. Select the feature when compiling the library to handle this message.

ButtonParseError(ButtonParseError)

An error occurred while parsing a ButtonEvent.

InvalidLength(usizeusize)

The event in the message did not have the expected length. The first value is the expected length, the second the actual length.

InvalidCrc(u8u16)

The event in the message did not have the expected CRC. The first value is the expected CRC, the second the actual CRC.

InvalidFloatSize(usize)

There was a problem parsing a float from a message. The parameter gives the length of the received input.

Trait Implementations

Formats the value using the given formatter. Read more
Writes the defmt representation of self to fmt.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.