1pub mod archive;
8pub mod dat;
9
10pub use archive::ZipExtractor;
11pub use dat::{DatReader, ParsedLine};
12
13use thiserror::Error;
14
15#[derive(Error, Debug)]
17pub enum ParseError {
18 #[error("I/O error: {0}")]
20 Io(#[from] std::io::Error),
21
22 #[error("invalid record format on line {line}: {message}")]
24 InvalidFormat { line: usize, message: String },
25
26 #[error("unknown record type: {0}")]
28 UnknownRecordType(String),
29
30 #[error("failed to parse field {field} on line {line}: {message}")]
32 FieldParse {
33 line: usize,
34 field: String,
35 message: String,
36 },
37
38 #[error("ZIP error: {0}")]
40 Zip(#[from] ::zip::result::ZipError),
41}
42
43pub type Result<T> = std::result::Result<T, ParseError>;