5 releases

0.5.1 Mar 29, 2021
0.5.0 Apr 2, 2020
0.5.0-rc.2 Apr 1, 2020
0.5.0-rc.1 Mar 28, 2020
0.5.0-rc Mar 20, 2020

#261 in HTTP server

Download history 3/week @ 2021-07-05 1/week @ 2021-07-12 7/week @ 2021-07-19 8/week @ 2021-07-26 14/week @ 2021-08-02 2/week @ 2021-08-09 10/week @ 2021-08-16 1/week @ 2021-08-23 1/week @ 2021-08-30 1/week @ 2021-09-06 2/week @ 2021-09-13 2/week @ 2021-09-20 10/week @ 2021-09-27 3/week @ 2021-10-04 6/week @ 2021-10-11 2/week @ 2021-10-18

78 downloads per month

MIT license

165KB
3.5K SLoC

Stable Test codecov Rust Docs Crate version Download License: MIT

This crate provides tokio-based runtime and acceptor for roa.

use roa::http::StatusCode;
use roa::{App, Context};
use roa_tokio::{TcpIncoming, Exec};
use std::error::Error;

async fn end(_ctx: &mut Context) -> roa::Result {
    Ok(())
}

#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
    let app = App::with_exec((), Exec).end(end);
    let incoming = TcpIncoming::bind("127.0.0.1:0")?;
    println!("server is listening on {}", incoming.local_addr());
    app.accept(incoming).await?;
    Ok(())
}

Dependencies

~10MB
~210K SLoC

a`