pub struct ProxyAddressLayer { /* private fields */ }std only.Expand description
Apply one fixed proxy address to any service input with extensions.
This layer reads application environment variables only when constructed
with try_from_env. It does not inspect operating
system proxy settings; use SystemProxyLayer for those. When the layers
are chained, existing route decisions are preserved by default. Opt into
overwriting only when this address is authoritative. Use
LazyProxyAddressLayer when environment lookup should happen only if
no higher-priority route has already been selected.
See ProxyAddressService for more information.
Implementations§
Source§impl ProxyAddressLayer
impl ProxyAddressLayer
Sourcepub fn new(address: ProxyAddress) -> Self
pub fn new(address: ProxyAddress) -> Self
Create a new ProxyAddressLayer that will create
a service to set the given ProxyAddress as a proxied ProxyRoute.
Sourcepub fn maybe(address: Option<ProxyAddress>) -> Self
pub fn maybe(address: Option<ProxyAddress>) -> Self
Create a new ProxyAddressLayer which will create
a service that will set the given ProxyAddress as a proxied ProxyRoute if it is not
None.
Sourcepub const fn proxy_address(&self) -> Option<&ProxyAddress>
pub const fn proxy_address(&self) -> Option<&ProxyAddress>
Return the configured proxy address, when this layer has one.
Sourcepub fn try_from_env_default() -> Result<Self, BoxError>
pub fn try_from_env_default() -> Result<Self, BoxError>
Try to create a new ProxyAddressLayer which will establish
a proxy connection over the environment variable http_proxy.
Uppercase HTTP_PROXY is deliberately not accepted by default because
CGI derives it from an incoming Proxy header. Use
ProxyEnvLayer for curl-compatible HTTP, HTTPS, and all-protocol
environment selection.
Sourcepub fn try_from_env(key: impl AsRef<str>) -> Result<Self, BoxError>
pub fn try_from_env(key: impl AsRef<str>) -> Result<Self, BoxError>
Try to create a new ProxyAddressLayer which will establish
a proxy connection over the given environment variable.
Sourcepub fn with_overwrite(self, overwrite: bool) -> Self
pub fn with_overwrite(self, overwrite: bool) -> Self
Replace an existing ProxyRoute or ProxyRoutes decision.
Existing routes are preserved by default.
Sourcepub fn set_overwrite(&mut self, overwrite: bool) -> &mut Self
pub fn set_overwrite(&mut self, overwrite: bool) -> &mut Self
Replace an existing ProxyRoute or ProxyRoutes decision.
Existing routes are preserved by default.
Trait Implementations§
Source§impl Clone for ProxyAddressLayer
impl Clone for ProxyAddressLayer
Source§fn clone(&self) -> ProxyAddressLayer
fn clone(&self) -> ProxyAddressLayer
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProxyAddressLayer
impl Debug for ProxyAddressLayer
Source§impl Default for ProxyAddressLayer
impl Default for ProxyAddressLayer
Source§fn default() -> ProxyAddressLayer
fn default() -> ProxyAddressLayer
Source§impl<S> Layer<S> for ProxyAddressLayer
impl<S> Layer<S> for ProxyAddressLayer
Source§type Service = ProxyAddressService<S>
type Service = ProxyAddressService<S>
Source§fn layer(&self, inner: S) -> Self::Service
fn layer(&self, inner: S) -> Self::Service
Source§fn into_layer(self, inner: S) -> Self::Service
fn into_layer(self, inner: S) -> Self::Service
layer but consuming self after the service was created. Read moreAuto Trait Implementations§
impl !Freeze for ProxyAddressLayer
impl RefUnwindSafe for ProxyAddressLayer
impl Send for ProxyAddressLayer
impl Sync for ProxyAddressLayer
impl Unpin for ProxyAddressLayer
impl UnsafeUnpin for ProxyAddressLayer
impl UnwindSafe for ProxyAddressLayer
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> ⓘ
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> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
Source§impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
type Error = <U as RamaTryFrom<T, CrateMarker>>::Error
fn rama_try_into(self) -> Result<U, <U as RamaTryFrom<T, CrateMarker>>::Error>
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<V, F> ValueFormatter<&V> for F
impl<V, F> ValueFormatter<&V> for F
Source§const SHAPE: FieldShape<'static>
const SHAPE: FieldShape<'static>
metrique_require_explicit_impls only.Source§fn format_value(writer: impl ValueWriter, value: &&V)
fn format_value(writer: impl ValueWriter, value: &&V)
value to writerSource§impl<V, F> ValueFormatter<Arc<V>> for F
impl<V, F> ValueFormatter<Arc<V>> for F
Source§const SHAPE: FieldShape<'static>
const SHAPE: FieldShape<'static>
metrique_require_explicit_impls only.Source§fn format_value(writer: impl ValueWriter, value: &Arc<V>)
fn format_value(writer: impl ValueWriter, value: &Arc<V>)
value to writerSource§impl<V, F> ValueFormatter<Box<V>> for F
impl<V, F> ValueFormatter<Box<V>> for F
Source§const SHAPE: FieldShape<'static>
const SHAPE: FieldShape<'static>
metrique_require_explicit_impls only.Source§fn format_value(writer: impl ValueWriter, value: &Box<V>)
fn format_value(writer: impl ValueWriter, value: &Box<V>)
value to writerSource§impl<V, F> ValueFormatter<Cow<'_, V>> for F
impl<V, F> ValueFormatter<Cow<'_, V>> for F
Source§const SHAPE: FieldShape<'static>
const SHAPE: FieldShape<'static>
metrique_require_explicit_impls only.Source§fn format_value(writer: impl ValueWriter, value: &Cow<'_, V>)
fn format_value(writer: impl ValueWriter, value: &Cow<'_, V>)
value to writerSource§impl<V, F> ValueFormatter<Option<V>> for Fwhere
F: ValueFormatter<V> + ?Sized,
impl<V, F> ValueFormatter<Option<V>> for Fwhere
F: ValueFormatter<V> + ?Sized,
Source§const SHAPE: FieldShape<'static>
const SHAPE: FieldShape<'static>
metrique_require_explicit_impls only.Source§fn format_value(writer: impl ValueWriter, value: &Option<V>)
fn format_value(writer: impl ValueWriter, value: &Option<V>)
value to writer