rustiful 0.1.0

This crate is for creating a JSONAPI backend, backed by Iron.
use std::error::Error;
use std::fmt::*;

#[derive(Debug)]
/// Wraps user errors that happens in `FromRequest` impls.
pub struct FromRequestError<T: Error + Send>(pub T);

impl<T> Error for FromRequestError<T>
    where T: Error + Send
{
    fn description(&self) -> &str {
        self.0.description()
    }

    fn cause(&self) -> Option<&Error> {
        Some(&self.0)
    }
}


impl<T> Display for FromRequestError<T>
    where T: Error + Send
{
    fn fmt(&self, f: &mut Formatter) -> Result {
        write!(f, "From request error: {}", self.0)
    }
}