pub struct Upstream { /* private fields */ }Expand description
Streaming HTTP client for local servers.
Implementations§
Source§impl Upstream
impl Upstream
Sourcepub fn new(limits: ProxyLimits) -> Result<Self, ProxyError>
pub fn new(limits: ProxyLimits) -> Result<Self, ProxyError>
Client with the limits’ connect timeout.
Sourcepub fn limits(&self) -> &ProxyLimits
pub fn limits(&self) -> &ProxyLimits
Limits in force.
Sourcepub async fn forward(
&self,
base: &str,
req: &ProxyRequest,
send_auth: bool,
sink: &mut dyn ResponseSink,
) -> Result<(), ProxyError>
pub async fn forward( &self, base: &str, req: &ProxyRequest, send_auth: bool, sink: &mut dyn ResponseSink, ) -> Result<(), ProxyError>
Forward req to the verified loopback base, relaying the response
into sink as it arrives. send_auth is true only for a request from
a local client on this node’s loopback listener: the client chose to
send that credential to this address, and a server started with
--api-key needs it. It is forwarded to the local instance only and
never over the mesh; it is false for every request that arrived over
the mesh (a peer’s credentials are not ours to pass on).
Auto Trait Implementations§
impl !RefUnwindSafe for Upstream
impl !UnwindSafe for Upstream
impl Freeze for Upstream
impl Send for Upstream
impl Sync for Upstream
impl Unpin for Upstream
impl UnsafeUnpin for Upstream
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
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more