pub enum Error<I, E> {
NonAscii,
ChecksumMismatch {
expected: u8,
found: u8,
},
ParsingError(E),
UnrecognizedMessage(I),
InvalidField(I),
Unknown,
}Expand description
Represents all possible errors that can occur during NMEA message parsing.
This enum covers various failure modes including input validation, checksum verification, and parsing errors.
Variants§
NonAscii
The provided input contains non-ASCII characters.
NMEA messages must be ASCII-only for proper parsing and checksum calculation.
ChecksumMismatch
The checksum of the sentence was corrupt or incorrect.
Contains both the expected checksum (calculated from the message content) and the actual checksum found in the message.
Fields
ParsingError(E)
The sentence could not be parsed because its format was invalid.
This wraps nom’s standard parsing errors and provides context about what went wrong during parsing.
UnrecognizedMessage(I)
The message type is not recognized by the parser.
This variant is used when a valid NMEA sentence is encountered, but the parser does not implement handling for this specific message type. The message type that caused the error is provided for reference.
InvalidField(I)
A field in the NMEA sentence was invalid.
This error occurs when a specific field in the NMEA sentence does not conform to the expected format, type, or value range.
Contains the input that caused the error.
Unknown
An unknown error occurred.
This is a catch-all for unexpected error conditions.