libecvrf/
error.rs

1/// Lib EC-VRF error
2#[derive(Debug, Clone, Copy, Eq, PartialEq)]
3pub enum Error {
4    /// Unknow error
5    UnknowError,
6    /// Out of range
7    OutOfRange,
8    /// Unable to convert bytes to scalar
9    UnableToConvertBytesToScalar,
10    /// Retries exceeded
11    RetriesExceeded,
12}
13
14#[cfg(feature = "std")]
15impl std::error::Error for Error {}
16
17impl core::fmt::Display for Error {
18    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
19        match self {
20            Error::UnknowError => write!(f, "Unknow error"),
21            Error::OutOfRange => write!(f, "Out of range"),
22            Error::UnableToConvertBytesToScalar => write!(f, "Unable to convert bytes to scalar"),
23            Error::RetriesExceeded => write!(f, "Retries exceeded"),
24        }
25    }
26}