pub enum PreparedRequest {
Direct(Request<Bytes>),
Custom(CustomSend),
CustomStream(CustomStreamSend),
}Expand description
The output of Channel::prepare: either a single direct upstream request
(the common case — the pipeline sends it once), or a channel-driven
multi-step exchange (CustomSend).
Proxy and TLS-emulation are NOT carried here — they are per-credential /
global / channel-default concerns resolved by the executor
not the channel’s to decide; the executor injects the resolved client into a
Custom closure.
Variants§
Direct(Request<Bytes>)
Normal single send. request.uri() MUST be absolute (scheme + authority
- path + query) — wreq cannot route a relative URI.
Custom(CustomSend)
Channel-driven buffered multi-step exchange.
CustomStream(CustomStreamSend)
Channel-driven multi-step exchange that streams its body incrementally Native only.
Implementations§
Source§impl PreparedRequest
impl PreparedRequest
Sourcepub fn custom(send: CustomSend) -> Self
pub fn custom(send: CustomSend) -> Self
Wrap a channel-driven multi-step exchange closure.
Sourcepub fn custom_stream(send: CustomStreamSend) -> Self
pub fn custom_stream(send: CustomStreamSend) -> Self
Wrap a streaming channel-driven multi-step exchange closure.
Sourcepub async fn send_buffered(
self,
client: Arc<dyn UpstreamClient>,
) -> Result<Response<Bytes>, ClientError>
pub async fn send_buffered( self, client: Arc<dyn UpstreamClient>, ) -> Result<Response<Bytes>, ClientError>
Execute this request in a host path that requires a buffered response. Buffered custom exchanges use the same resolved client as direct requests. A streaming-only exchange is rejected as a recoverable host configuration error instead of being consumed or panicking.
Sourcepub fn into_http(self) -> Result<Request<Bytes>, ClientError>
pub fn into_http(self) -> Result<Request<Bytes>, ClientError>
Consume a direct request without executing it.
Custom exchanges require a host-provided UpstreamClient and must use
send_buffered or the streaming pipeline executor.