pub struct Proxy { /* private fields */ }Implementations§
Source§impl Proxy
impl Proxy
pub fn new(address: SocketAddr) -> Self
Sourcepub fn set_expire(&mut self, expire: Duration)
pub fn set_expire(&mut self, expire: Duration)
Set the maximum idle time before an Upstream connection is discarded.
Sourcepub fn set_max_idle_conns(&mut self, max: usize)
pub fn set_max_idle_conns(&mut self, max: usize)
Limit idle connections per Transport for this Upstream; zero means unlimited.
Sourcepub fn set_max_age(&mut self, max_age: Duration)
pub fn set_max_age(&mut self, max_age: Duration)
Set maximum connection age from creation; zero means unlimited.
Sourcepub fn set_read_timeout(&mut self, read_timeout: Duration)
pub fn set_read_timeout(&mut self, read_timeout: Duration)
Set the Response read timeout (two seconds by default).
Sourcepub fn set_source_address(&mut self, source: Option<IpAddr>)
pub fn set_source_address(&mut self, source: Option<IpAddr>)
Bind new Upstream and health-check connections to this local IP.
Sourcepub fn set_metrics(&mut self, registry: &Registry, name: &str)
pub fn set_metrics(&mut self, registry: &Registry, name: &str)
Register the Upstream’s metrics with the server’s exporter.
Sourcepub fn set_health_config(&mut self, config: HealthConfig)
pub fn set_health_config(&mut self, config: HealthConfig)
Configure health checks before starting exchanges.
pub fn down(&self) -> bool
pub async fn exchange( &self, query: &[u8], response: &mut [u8], transport: Transport, options: Options, ) -> Result<Exchange, Error>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Proxy
impl Forget for Proxy
impl Move for Proxy
impl RefUnwindSafe for Proxy
impl Send for Proxy
impl Sync for Proxy
impl Unpin for Proxy
impl UnsafeUnpin for Proxy
impl UnwindSafe for Proxy
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 moreimpl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Apply a transformation to the response body. Read more
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using HTTP status codes. Read more
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using gRPC headers. Read more