Introduction
Streamer is a handy tool deal with stream, it provides a set of structs and trait to stream
FileString&'static strVec<T>[T; N]Box<[T]>
Quick Start
Some example to walk you through:
use ;
async
it output:
async
it output:
Hyper Body Integration
Since I am heavy user of hyper,
send body of request is not that convenient as others
especially for streaming image, video document and so on.
it enable you stream large file in chunks in HTTP Format
To use, enable hyper feature
[]
= { = "*", = ["hyper"] }
use :
let file = open.unwrap;
let mut streaming = new;
streaming.meta.set_buf_len; // length sent as a chunk, the default is 64kB
streaming.meta.set_name; // field name
streaming.meta.set_filename; // file name
let body: Body = streaming.streaming;
// build a request
let request: = post.body.expect;
it will sennd the file info in 10-bytes chunks, each chunk are formated into HTTP multipart/form-data, with this you can split large file and stream it chunks by chunks.
Features to Add
May be some compression could be done to lower network traffic
- Streaming Chunks Compression