use std::error;
use std::fmt;
use std::result;
#[derive(Debug)]
pub enum GrafenError {
RunError(String),
}
pub type Result<T> = result::Result<T, GrafenError>;
impl fmt::Display for GrafenError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GrafenError::RunError(ref err) => {
write!(f, "{}", err)
},
}
}
}
impl error::Error for GrafenError {
fn description(&self) -> &str {
match *self {
GrafenError::RunError(ref err) => &err,
}
}
fn cause(&self) -> Option<&error::Error> {
match *self {
GrafenError::RunError(_) => None, }
}
}