uhttp_chunked_write 0.5.1

HTTP chunked response writer
Documentation
  • Coverage
  • 100%
    3 out of 3 items documented1 out of 3 items with examples
  • Size
  • Source code size: 5.11 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 329.36 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • kchmck/uhttp_chunked_write.rs
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • kchmck

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.

Example

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"[..]);