pub struct PartDataStream<S>{ /* private fields */ }Expand description
A self-contained stream produced by Part::take_data_stream.
The stream yields the part’s data chunks — each one non-empty, so a part
with no data yields nothing at all — and ends at the closing
delimiter \r\n--boundary. What follows the delimiter (the strict
closing trailer, an epilogue, or another part) is not interpreted; call
PartDataStream::into_final to obtain a FinalPartDataStream that
yields any remaining data and enforces the strict closing trailer.
Implementations§
Source§impl<S> PartDataStream<S>
impl<S> PartDataStream<S>
Sourcepub fn multipart_consumed(&self) -> u64
pub fn multipart_consumed(&self) -> u64
Returns the total number of multipart bytes consumed at the moment this stream was taken, excluding bytes retained in the internal buffer.
This is the value to subtract from the request Content-Length when
deriving the exact file length. It does not count bytes yielded by
this stream itself.
Sourcepub fn into_final(self) -> FinalPartDataStream<S>
pub fn into_final(self) -> FinalPartDataStream<S>
Converts this stream into a FinalPartDataStream, which yields any
remaining data and then enforces the strict closing trailer.
No data is discarded: chunks already read stay with the caller, and chunks not yet read are yielded by the returned stream before the closing trailer is validated.
A stream that ended abnormally — with an error, or at end of stream
before the delimiter — stays failed: the returned stream reports
Error::IncompleteStreamPart instead of validating a trailer that was
never reached.