pub enum ErrorKind {
InvalidCrc((Vec<u8>, FitObject, u16, u16)),
Io(Error),
MissingDefinitionMessage(u8, usize),
TrailingBytes(usize),
ParseError(usize, ErrorKind),
UnexpectedEof(Needed),
ValueError(String),
}
Expand description
The kind of error that can be produced during deserialization. TODO: Handle errors produced by nom cleanly
Variants§
InvalidCrc((Vec<u8>, FitObject, u16, u16))
Error when parsing succeeds but calculated CRC does not match value stored in file. We store the successful parsing result incase we want to ignore the CRC failure and containue parsing. The first u16 value is the expected CRC, the second is what was calculated from the data.
Io(Error)
Errors tied to IO issues and not the actual parsing steps.
MissingDefinitionMessage(u8, usize)
If a definition mesage can’t be found, postion of message and local message number
TrailingBytes(usize)
Trailing bytes remain after parsing
ParseError(usize, ErrorKind)
Errors generated by trying to parse invalid data with a nom combinator
UnexpectedEof(Needed)
Errors tied to insufficent data in the buffer, similar to an IO error but coming from nom
ValueError(String)
Errors related to interactions with a Value enum