#[allow(clippy::module_name_repetitions)]
#[derive(Debug, thiserror::Error)]
pub enum ParserError {
#[error("{0}")]
Io(#[from] std::io::Error),
#[error("buffer is not supposed to be longer than {expected} bytes but got {got}")]
BufferTooLong {
expected: usize,
got: usize,
},
#[error("parsing email failed: {0}")]
InvalidMail(String),
#[error("Mandatory header '{0}' not found")]
MandatoryHeadersNotFound(String),
#[error("Boundary not found in content-type header parameters, {0}")]
BoundaryNotFound(String),
#[error("Misplaced boundary in mime message, {0}")]
MisplacedBoundary(String),
}
pub type ParserResult<T> = Result<T, ParserError>;