use thiserror::Error;
#[derive(Debug, Clone, PartialEq, Eq, Error)]
pub enum PrfBuildError {
#[error("a map value was supplied without a preceding key")]
ValueWithoutKey,
#[error("a map key was supplied before the preceding key received a value")]
KeyWithoutValue,
#[error("a map ended while a key was still waiting for a value")]
DanglingKey,
#[error("a map key was supplied more than once")]
DuplicateKey,
#[error("the backend rejected a boxed passthrough value")]
InvalidPassthrough,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Error)]
pub enum PrfVisitorError {
#[error("the PRF result had an unexpected structural shape")]
UnexpectedShape,
#[error("the PRF result could not be converted to the requested value")]
InvalidValue,
}
#[derive(Debug, PartialEq, Eq, Error)]
pub enum PrfError<E> {
#[error("failed to build PRF operation: {0}")]
Build(#[from] PrfBuildError),
#[error("failed to interpret PRF result: {0}")]
Visitor(#[from] PrfVisitorError),
#[error("PRF backend failed: {0}")]
Backend(E),
}