Module multipart
http and multipart and std only.Expand description
Sans-IO multipart/form-data codec (RFC 7578, framing per RFC 2046 §5.1.1).
Parser turns body chunks into Events and Encoder renders the
framing of a body, neither doing any I/O of its own. Part data is handed
out as slices of the chunks that were fed, so a body can be read, or
rewritten while it streams through a proxy, without buffering or copying
what its parts hold.
To rewrite a body in flight, step the parser and answer each event:
forward a part by passing its headers to Encoder::part and its
Event::Data chunks through as they are, drop a part by skipping its
events, replace its data by writing other bytes, add a part by calling
Encoder::part with headers of your own, and close the body with
Encoder::finish. The output is framed afresh: preamble, epilogue and
transport padding of the input are not carried over.
The server-side extractor built on this parser is
Multipart, the
client-side form builder lives in crate::service::client::multipart.
Structs§
- Boundary
- A validated
multipartboundary, theboundaryparameter of the body’sContent-Type. - Encoder
- Sans-IO writer of the framing of a
multipart/form-databody. - Form
Data - The parameters of a
form-datadisposition that name a part. - Invalid
Boundary - The boundary cannot frame a
multipartbody. - Invalid
Content Disposition - The value is not a well-formed
form-datadisposition. - Parser
- Sans-IO parser of a
multipart/form-databody.
Enums§
- Event
- A step of progress through a
multipart/form-databody. - Parse
Error - Why a body is not a well-formed
multipart/form-databody.