tex_rs/error.rs
1use std::error::Error;
2use std::fmt;
3use std::fmt::{Debug, Display, Formatter};
4
5/// TexError that is used for custom error handling
6#[derive(Debug)]
7pub enum TexError {
8 /// Error in priority ranking
9 RankError,
10}
11
12impl Display for TexError {
13 fn fmt(&self, f: &mut Formatter) -> fmt::Result {
14 match *self {
15 TexError::RankError => write!(f, "Rank Error"),
16 }
17 }
18}
19
20impl Error for TexError {
21 fn source(&self) -> Option<&(dyn Error + 'static)> {
22 match *self {
23 TexError::RankError => None,
24 }
25 }
26}