alux-http-warp 0.1.0

warp interpretation of ALUX typed HTTP programs
Documentation
//! Holds this interpretation to the shared opening and closing contract.

use alux_http::HttpProgramExt;
use alux_http_conformance::{ExpectLifecycleExt, LifecycleApiExt, Shop};
use alux_http_warp::{WarpHandlerImpl, WarpRoute, WarpServer};

/// Compiles the shared lifecycle surface as the route this interpretation serves.
fn route() -> WarpRoute {
    let api = WarpHandlerImpl::new(Shop);

    api.compile_http(api.lifecycle_api::<Shop>())
}

#[tokio::test]
async fn reopens_the_address_it_closed() {
    WarpServer.expect_reopening(route).await.unwrap();
}

#[tokio::test]
async fn reopens_the_address_it_closed_while_a_connection_is_held() {
    WarpServer.expect_reopening_while_a_connection_is_held(route).await.unwrap();
}

#[tokio::test]
async fn answers_a_request_in_flight_when_it_closes() {
    WarpServer.expect_answering_what_is_in_flight(route).await.unwrap();
}

#[tokio::test]
async fn ends_a_request_that_outlives_the_drain_when_it_closes() {
    WarpServer.expect_ending_what_outlives_the_drain(route).await.unwrap();
}