1use std::num::{ParseFloatError, ParseIntError};
2#[derive(Debug)]
3pub enum ParseError {
4 IncompleteHeader,
5 IncompleteFrame,
6 InvalidVectorLength { expected: usize, found: usize },
7 InvalidNumberFormat(String),
8}
9
10impl From<ParseFloatError> for ParseError {
11 fn from(e: ParseFloatError) -> Self {
12 ParseError::InvalidNumberFormat(e.to_string())
13 }
14}
15
16impl From<ParseIntError> for ParseError {
17 fn from(e: ParseIntError) -> Self {
18 ParseError::InvalidNumberFormat(e.to_string())
19 }
20}