prost_validate/errors/enum.rs
1use thiserror::Error;
2
3#[derive(Debug, Clone, Error)]
4pub enum Error {
5 #[error("must be equal to {0:?}")]
6 Const(i32),
7 #[error("must be only one of the specified values")]
8 DefinedOnly,
9 #[error("must be in {0:?}")]
10 In(Vec<i32>),
11 #[error("must not be in {0:?}")]
12 NotIn(Vec<i32>),
13}
14
15impl From<Error> for super::Error {
16 fn from(value: Error) -> Self {
17 Self::Enum(value)
18 }
19}