use futures::{Future, Poll};
use errors::Error;

/// A future that resolves into a Fixerio response.
pub struct FixerioFuture<T> {
    inner: Box<Future<Item = T, Error = Error>>,
}

impl<T> FixerioFuture<T> {
    pub(crate) fn new(inner: Box<Future<Item = T, Error = Error>>) -> Self {
        Self { inner: inner }
    }
}

impl<T> Future for FixerioFuture<T> {
    type Item = T;
    type Error = Error;

    fn poll(&mut self) -> Poll<Self::Item, Self::Error> {
        self.inner.poll()
    }
}
{'avg_line_length': 22.681818181818183, 'max_line_length': 76, 'alphanum_fraction': 0.6052104208416834, 'licenses': ['MIT'], 'repository_name': 'sb89/fixerio', 'path': 'src/future.rs', 'size': 499, 'lang': 'Rust'}