1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! Request-side streaming types — the request counterpart to [`ResponseChunk`].
//!
//! In streaming mode (`stream_request_body`) the HTTP plugin delivers the
//! request body to PHP as a channel instead of buffering it. Two shapes:
//!
//! * [`RequestBody::Raw`] — opaque body bytes (`folk_read` / `folk_read_all`).
//! * [`RequestBody::Parts`] — a parsed `multipart/form-data` stream
//! (`folk_next_part` + `folk_part_read`), produced by a `multer` task in the
//! plugin so PHP never sees boundary bytes.
//!
//! [`ResponseChunk`]: crate::response::ResponseChunk
use Bytes;
use mpsc;
/// One element of a streamed `multipart/form-data` request.
///
/// The plugin emits, per field: one [`RequestPart::Start`], zero or more
/// [`RequestPart::Data`] chunks, then one [`RequestPart::End`]. The channel
/// closing signals "no more parts".
/// What feeds a worker's request body in streaming mode.
///
/// Exactly one variant is created per streamed request, chosen by the HTTP
/// plugin from the request `Content-Type`.