routerify_ng 0.3.1

A lightweight, idiomatic, composable and modular router implementation with middleware support for the Rust HTTP library hyper.rs 1.7.
Documentation
use http::Extensions;

#[derive(Debug)]
pub(crate) struct DataMap {
    inner: Extensions,
}

impl DataMap {
    pub fn new() -> DataMap {
        DataMap {
            inner: Extensions::new(),
        }
    }

    pub fn insert<T: Clone + Send + Sync + 'static>(&mut self, val: T) {
        self.inner.insert(val);
    }

    pub fn get<T: Send + Sync + 'static>(&self) -> Option<&T> {
        self.inner.get::<T>()
    }
}