pub struct ForwardOp {
pub cluster: ClusterId,
pub method: HttpMethod,
pub path: String,
pub query: Option<String>,
pub endpoint: Option<String>,
pub protocol: Protocol,
pub trace: Option<TraceContext>,
pub forward_headers: Vec<(String, String)>,
}Expand description
A verbatim forward whose request body is a stream, not buffered bytes
(ADR-014 stage 2): the same destination shape as CursorOp but the body is
supplied separately as a ByteBody so it can be
piped from the downstream connection straight to the upstream without ever
being collected. Used by the tenant-agnostic passthrough path.
Fields§
§cluster: ClusterIdThe cluster to forward to.
method: HttpMethodThe HTTP method to forward.
path: StringThe upstream path, forwarded verbatim.
query: Option<String>An already-allow-listed query string (without the ?) to append upstream.
endpoint: Option<String>The cluster’s base URL, when known (so the pool can be built on any
instance). None reuses an existing pool, erroring if none exists.
protocol: ProtocolThe upstream wire protocol. Defaults to Protocol::Http1.
trace: Option<TraceContext>The W3C trace context to forward downstream.
forward_headers: Vec<(String, String)>Client headers to relay verbatim to the upstream (the forwarding policy’s
output). Applied before trace. Empty by default.
Implementations§
Source§impl ForwardOp
impl ForwardOp
Sourcepub fn new(
cluster: ClusterId,
method: HttpMethod,
path: impl Into<String>,
) -> Self
pub fn new( cluster: ClusterId, method: HttpMethod, path: impl Into<String>, ) -> Self
Constructs a streaming forward op (defaulting to HTTP/1.1 upstream).
Sourcepub fn with_forward_headers(self, headers: Vec<(String, String)>) -> Self
pub fn with_forward_headers(self, headers: Vec<(String, String)>) -> Self
Sets the client headers to relay verbatim to the upstream (builder style).
Sourcepub fn with_endpoint(self, endpoint: Option<String>) -> Self
pub fn with_endpoint(self, endpoint: Option<String>) -> Self
Sets the cluster’s base URL (builder style).
Sourcepub fn with_query(self, query: Option<String>) -> Self
pub fn with_query(self, query: Option<String>) -> Self
Sets the (already allow-listed) upstream query string (builder style).
Sourcepub fn with_protocol(self, protocol: Protocol) -> Self
pub fn with_protocol(self, protocol: Protocol) -> Self
Sets the upstream wire protocol (builder style).
Sourcepub fn with_trace(self, trace: Option<TraceContext>) -> Self
pub fn with_trace(self, trace: Option<TraceContext>) -> Self
Sets the trace context to propagate downstream (builder style).
Trait Implementations§
impl Eq for ForwardOp
impl StructuralPartialEq for ForwardOp
Auto Trait Implementations§
impl Freeze for ForwardOp
impl RefUnwindSafe for ForwardOp
impl Send for ForwardOp
impl Sync for ForwardOp
impl Unpin for ForwardOp
impl UnsafeUnpin for ForwardOp
impl UnwindSafe for ForwardOp
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.