libjuice_rs/
error.rs

1use std::fmt::{Display, Formatter};
2
3pub type Result<T> = std::result::Result<T, Error>;
4
5#[derive(Debug, PartialEq, Copy, Clone)]
6pub enum Error {
7    InvalidArgument,
8    Failed,
9    NotAvailable,
10}
11
12impl std::error::Error for Error {}
13
14impl Display for Error {
15    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
16        match self {
17            Error::InvalidArgument => write!(f, "invalid argument"),
18            Error::Failed => write!(f, "failure"),
19            Error::NotAvailable => write!(f, "not available"),
20        }
21    }
22}