1use std::error::Error;
3use std::{fmt, result};
4
5pub type Result<T, E = FindSimdocError> = result::Result<T, E>;
7
8#[derive(Debug)]
10pub enum FindSimdocError {
11 Input(InputError),
13}
14
15impl fmt::Display for FindSimdocError {
16 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
17 match self {
18 Self::Input(e) => e.fmt(f),
19 }
20 }
21}
22
23impl Error for FindSimdocError {}
24
25impl FindSimdocError {
26 pub(crate) const fn input(msg: &'static str) -> Self {
27 Self::Input(InputError { msg })
28 }
29}
30
31#[derive(Debug)]
33pub struct InputError {
34 msg: &'static str,
35}
36
37impl fmt::Display for InputError {
38 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
39 write!(f, "InputError: {}", self.msg)
40 }
41}