Skip to main content

statum_core/
lib.rs

1#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2#[derive(Debug)]
3pub enum Error {
4    InvalidState,
5}
6
7impl<T> From<Error> for core::result::Result<T, Error> {
8    fn from(val: Error) -> Self {
9        Err(val)
10    }
11}
12
13impl core::fmt::Display for Error {
14    fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::result::Result<(), core::fmt::Error> {
15        write!(fmt, "{self:?}")
16    }
17}
18
19impl std::error::Error for Error {}