amiya 0.0.6

experimental middleware-based minimalism async HTTP server framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
use amiya::{Context, Result};

#[allow(dead_code)]
pub async fn response<T, D: AsRef<str>>(data: D, mut ctx: Context<'_, T>) -> Result
where
    T: Send + Sync + 'static,
{
    ctx.next().await?;
    ctx.resp.set_body(data.as_ref());
    Ok(())
}