Function mime_multipart::parse_multipart_body [] [src]

pub fn parse_multipart_body<S: Read>(stream: &mut S, headers: &Headers, always_use_files: bool) -> Result<Vec<Node>, Error>

Parse a MIME multipart/* from a Readable stream into a Vec of Nodes, streaming files to disk and keeping the rest in memory. Recursive multipart/* parts will are parsed as well and returned within a Node::Multipart variant.

If always_use_files is true, all parts will be streamed to files. If false, only parts with a ContentDisposition header set to Attachment or otherwise containing a Filename parameter will be streamed to files.

It is presumed that you have the Headers already and the stream starts at the body. If the headers are still in the stream, use parse_multipart() instead.