Skip to main content

parse_multipart_stream

Function parse_multipart_stream 

Source
pub fn parse_multipart_stream<T, S, E>(
    body: S,
    boundary: &str,
) -> MultipartStream<T, S>
where S: Stream<Item = Result<Bytes, E>> + Unpin + 'static, E: Display, T: DeserializeOwned + 'static,
Expand description

Parse a multipart/mixed byte stream into a stream of typed items.

body is typically the byte-stream view of toolkit_http::HttpResponse::into_body() (adapted via crate::runtime::http::body_to_byte_stream); boundary is the value returned by boundary_from_content_type — the bare token, with no leading dashes. Errors from the inner stream are surfaced as TransportError::Network.