http-service 0.2.0

Types and traits for standardizing async HTTP services failed to build http-service-0.2.0
Please check build logs and if you believe this is' fault, report into this issue report.


The crate http-service provides the necessary types and traits to implement your own HTTP Server. It uses hyper for the lower level TCP abstraction.

You can use the workspace member http-service-hyper to run your HTTP Server.

  1. Runs via http_service_hyper::run(HTTP_SERVICE, ADDRESS);
  2. Returns a future which can be awaited via http_service_hyper::serve(HTTP_SERVICE, ADDRESS);

This crate uses the latest Futures preview, and therefore needs to be run on Rust Nightly.



http-service = "0.1.5"
futures-preview = "0.3.0-alpha.14"

version = "0.1.1"

#![feature(futures_api, async_await, await_macro, existential_type)]

use futures::future::{self, FutureObj};
use http_service::{HttpService, Response};
use std::net::{IpAddr, Ipv4Addr, SocketAddr};

struct Server {
    message: Vec<u8>,

impl Server {
    fn create(message: Vec<u8>) -> Server {
        Server { message }

    pub fn run(s: Server) {
        let a = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 8080);
        http_service_hyper::run(s, a);

impl HttpService for Server {
    type Connection = ();
    type ConnectionFuture = future::Ready<Result<(), std::io::Error>>;
    type Fut = FutureObj<'static, Result<http_service::Response, std::io::Error>>;

    fn connect(&self) -> Self::ConnectionFuture {

    fn respond(&self, _conn: &mut (), _req: http_service::Request) -> Self::Fut {
        let message = self.message.clone();
        FutureObj::new(Box::new(async move {

fn main() {
    let s = Server::create(String::from("Hello, World").into_bytes());


MIT OR Apache-2.0