h2s_core/
error.rs

1//! Implementations of `std::error::Error`
2
3use std::fmt::{Debug, Display};
4
5use crate::element_selector::TargetElementSelector;
6use crate::extraction_method::{AttributeNotFound, ExtractionMethod, NotFound};
7use crate::functor::ExactlyOne;
8use crate::macro_utils::{ExtractionError, ParseError, ProcessError, TransformError};
9use crate::transformable::{VecToArrayError, VecToOptionError, VecToSingleError};
10use crate::traversable_with_context::Context;
11use crate::{Error, FieldError, Never};
12
13impl Error for VecToArrayError {}
14impl Error for VecToSingleError {}
15impl Error for VecToOptionError {}
16impl Error for AttributeNotFound {}
17impl<E> Error for ExactlyOne<E> where E: Error {}
18impl Error for Never {}
19impl Error for FieldError {}
20
21impl<S, E> Error for TransformError<S, E>
22where
23    Self: Display,
24    S: TargetElementSelector,
25    E: Error,
26{
27}
28
29impl<C, M> Error for ExtractionError<C, M>
30where
31    C: Context,
32    M: ExtractionMethod,
33{
34}
35
36impl<C, E> Error for ParseError<C, E>
37where
38    C: Context,
39    E: Error,
40{
41}
42
43impl<A, B, C> Error for ProcessError<A, B, C> where Self: Display + Debug {}
44
45impl Error for NotFound {}