prost_validate/errors/
enum.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use thiserror::Error;

#[derive(Debug, Clone, Error)]
pub enum Error {
    #[error("must be equal to {0:?}")]
    Const(i32),
    #[error("must be only one of the specified values")]
    DefinedOnly,
    #[error("must be in {0:?}")]
    In(Vec<i32>),
    #[error("must not be in {0:?}")]
    NotIn(Vec<i32>),
}

impl From<Error> for super::Error {
    fn from(value: Error) -> Self {
        Self::Enum(value)
    }
}