zon_middleware 0.0.6

part of a new WIP, very incomplete async http service stack
Documentation
pub trait HttpServiceExt {
    fn map_request<F>(self, f: F) -> crate::MapRequestService<Self, F>
    where
        Self: Sized,
    {
        crate::MapRequestService::new(self, f)
    }

    fn map_response<F>(self, f: F) -> crate::MapResponseService<Self, F>
    where
        Self: Sized,
    {
        crate::MapResponseService::new(self, f)
    }

    #[cfg(feature = "set-status")]
    fn set_status(self, status: http::StatusCode) -> crate::SetStatusService<Self>
    where
        Self: Sized,
    {
        crate::SetStatusService::new(self, status)
    }

    #[cfg(feature = "task-local")]
    fn set_task_local<T>(
        self,
        key: &'static tokio::task::LocalKey<T>,
        value: T,
    ) -> crate::SetTaskLocalService<Self, T>
    where
        Self: Sized,
        T: Clone + Send + Sync + 'static,
    {
        crate::SetTaskLocalService::new(self, key, value)
    }
}

impl<T> HttpServiceExt for T {}