Struct chunked_transfer::Encoder [] [src]

pub struct Encoder<W> where
    W: Write
{ /* fields omitted */ }

Splits the incoming data into HTTP chunks.


use chunked_transfer::Encoder;
use std::io::Write;

let mut decoded = "hello world";
let mut encoded: Vec<u8> = vec![];

    let mut encoder = Encoder::with_chunks_size(&mut encoded, 5);

assert_eq!(encoded, b"5\r\nhello\r\n5\r\n worl\r\n1\r\nd\r\n0\r\n\r\n");


impl<W> Encoder<W> where
    W: Write

Trait Implementations

impl<W> Write for Encoder<W> where
    W: Write

Write a buffer into this object, returning how many bytes were written. Read more

Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more

Attempts to write an entire buffer into this write. Read more

Writes a formatted string into this writer, returning any error encountered. Read more

Creates a "by reference" adaptor for this instance of Write. Read more

impl<W> Drop for Encoder<W> where
    W: Write

A method called when the value goes out of scope. Read more