uhttp_chunked_write 0.5.1

HTTP chunked response writer

This crate implements a zero-copy, zero-allocation writer for HTTP chunked response bodies. The result can be written directly into a TcpStream or any other object that implements Write.


use uhttp_chunked_write::ChunkedWrite;
use std::io::Write;

let mut buf = [0; 25];

    let mut body = ChunkedWrite::new(&mut buf[..]);
    write!(&mut body, "hello {}", 1337).unwrap();

assert_eq!(&buf[..], &b"6\r\nhello \r\n4\r\n1337\r\n0\r\n\r\n"[..]);