1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Debug, PartialEq, Eq)]
pub enum Error {
ColValNumMismatch { col_len: usize, val_len: usize },
}
impl std::error::Error for Error {}
impl std::fmt::Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
Self::ColValNumMismatch { col_len, val_len } => write!(
f,
"Columns and values length mismatch: {} != {}",
col_len, val_len
),
}
}
}