zon_core 0.0.4

part of a new WIP, very incomplete async http service stack
Documentation
use crate::service::HttpService;

pub enum Either<A, B> {
    A(A),
    B(B),
}

impl<B, S1, S2> HttpService<B> for Either<S1, S2>
where
    B: Send,
    S1: HttpService<B>,
    S2: HttpService<B, ResponseBody = S1::ResponseBody>,
{
    type ResponseBody = S1::ResponseBody;

    async fn call(&self, request: http::Request<B>) -> http::Response<Self::ResponseBody> {
        match self {
            Either::A(svc) => svc.call(request).await,
            Either::B(svc) => svc.call(request).await,
        }
    }
}