1use thiserror::Error;
2
3#[derive(Debug, Clone, PartialEq, Eq, Error)]
5pub enum PrfBuildError {
6 #[error("a map value was supplied without a preceding key")]
7 ValueWithoutKey,
8 #[error("a map key was supplied before the preceding key received a value")]
9 KeyWithoutValue,
10 #[error("a map ended while a key was still waiting for a value")]
11 DanglingKey,
12 #[error("a map key was supplied more than once")]
13 DuplicateKey,
14 #[error("the backend rejected a boxed passthrough value")]
15 InvalidPassthrough,
16}
17
18#[derive(Debug, Clone, Copy, PartialEq, Eq, Error)]
20pub enum PrfVisitorError {
21 #[error("the PRF result had an unexpected structural shape")]
22 UnexpectedShape,
23 #[error("the PRF result could not be converted to the requested value")]
24 InvalidValue,
25}
26
27#[derive(Debug, PartialEq, Eq, Error)]
33pub enum PrfError<E> {
34 #[error("failed to build PRF operation: {0}")]
35 Build(#[from] PrfBuildError),
36 #[error("failed to interpret PRF result: {0}")]
37 Visitor(#[from] PrfVisitorError),
38 #[error("PRF backend failed: {0}")]
39 Backend(E),
40}