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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//! # Generator-shape coroutine driver
//!
//! Mirrors the shape of `core::ops::Coroutine`: a `Yield` associated
//! type for intermediate progress, a `Return` associated type for
//! terminal output, and a two-variant [`DiscoveryCoroutineState`]
//! (`Yielded` / `Complete`).
//!
//! Naming and structure mirror io-http's [`HttpCoroutine`] /
//! [`HttpCoroutineState`] / [`HttpYield`] triad so the two crates
//! compose without an adapter shim per call site (HTTP-side
//! coroutines, like [`crate::shared::http::HttpGet`], simply translate
//! io-http's [`HttpSendYield`] into [`DiscoveryYield`]).
//!
//! Every pimconf coroutine yields the same [`DiscoveryYield`]
//! shape: each yielded step carries the [`Url`] of the endpoint the
//! coroutine wants to talk to, so the std client driver can route the
//! bytes to the correct stream via [`crate::shared::pool::StreamPool`].
//!
//! [`HttpCoroutine`]: io_http::coroutine::HttpCoroutine
//! [`HttpCoroutineState`]: io_http::coroutine::HttpCoroutineState
//! [`HttpYield`]: io_http::coroutine::HttpYield
//! [`HttpSendYield`]: io_http::rfc9110::send::HttpSendYield
use Vec;
use Url;
/// State yielded by a [`DiscoveryCoroutine::resume`] step.
///
/// Two-variant by design (matches std's `core::ops::CoroutineState`):
/// any further variation lives inside the per-coroutine `Yield` type.
/// Standard-shape pimconf coroutine.
///
/// Implementors own their internal state machine and declare their
/// per-step `Yield` plus a terminal `Return`. The driver pumps I/O
/// based on the `Yield` variant and resumes until `Complete`.
/// Standard I/O Yield for pimconf coroutines.
///
/// Both variants carry the [`Url`] of the endpoint the coroutine wants
/// to talk to so the driver can route bytes to the matching stream
/// (DNS resolver, HTTPS origin, …) via
/// [`crate::shared::pool::StreamPool`]. Pick `type Yield = DiscoveryYield`
/// for any coroutine that only needs to read or write socket bytes.