pub struct IpServiceBuilder<M> { /* private fields */ }http and net and haproxy and cli only.Expand description
Builder that can be used to run your own ip Service,
echo’ing back the client IP over http or tcp.
Implementations§
Source§impl IpServiceBuilder<Http>
impl IpServiceBuilder<Http>
Sourcepub fn http() -> Self
pub fn http() -> Self
Create a new IpServiceBuilder, echoing the IP back over L4.
Source§impl IpServiceBuilder<Transport>
impl IpServiceBuilder<Transport>
Sourcepub fn tcp() -> Self
pub fn tcp() -> Self
Create a new IpServiceBuilder, echoing the IP back over L4.
Source§impl<M> IpServiceBuilder<M>
impl<M> IpServiceBuilder<M>
Sourcepub fn with_concurrent(self, limit: usize) -> Self
pub fn with_concurrent(self, limit: usize) -> Self
set the number of concurrent connections to allow
Sourcepub fn set_concurrent(&mut self, limit: usize) -> &mut Self
pub fn set_concurrent(&mut self, limit: usize) -> &mut Self
set the number of concurrent connections to allow
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
set the timeout in seconds for each connection
Sourcepub fn set_timeout(&mut self, timeout: Duration) -> &mut Self
pub fn set_timeout(&mut self, timeout: Duration) -> &mut Self
set the timeout in seconds for each connection
Sourcepub fn maybe_with_forward(self, maybe_kind: Option<ForwardKind>) -> Self
pub fn maybe_with_forward(self, maybe_kind: Option<ForwardKind>) -> Self
maybe enable support for one of the following “forward” headers or protocols
Supported headers:
Forwarded (“for=”), X-Forwarded-For
X-Client-IP Client-IP, X-Real-IP
CF-Connecting-IP, True-Client-IP
Or using HaProxy protocol.
Sourcepub fn maybe_set_forward(
&mut self,
maybe_kind: Option<ForwardKind>,
) -> &mut Self
pub fn maybe_set_forward( &mut self, maybe_kind: Option<ForwardKind>, ) -> &mut Self
maybe enable support for one of the following “forward” headers or protocols
Supported headers:
Forwarded (“for=”), X-Forwarded-For
X-Client-IP Client-IP, X-Real-IP
CF-Connecting-IP, True-Client-IP
Or using HaProxy protocol.
Sourcepub fn with_forward(self, maybe_kind: ForwardKind) -> Self
pub fn with_forward(self, maybe_kind: ForwardKind) -> Self
maybe enable support for one of the following “forward” headers or protocols
Supported headers:
Forwarded (“for=”), X-Forwarded-For
X-Client-IP Client-IP, X-Real-IP
CF-Connecting-IP, True-Client-IP
Or using HaProxy protocol.
Sourcepub fn set_forward(&mut self, maybe_kind: ForwardKind) -> &mut Self
pub fn set_forward(&mut self, maybe_kind: ForwardKind) -> &mut Self
maybe enable support for one of the following “forward” headers or protocols
Supported headers:
Forwarded (“for=”), X-Forwarded-For
X-Client-IP Client-IP, X-Real-IP
CF-Connecting-IP, True-Client-IP
Or using HaProxy protocol.
Sourcepub fn without_forward(self) -> Self
pub fn without_forward(self) -> Self
maybe enable support for one of the following “forward” headers or protocols
Supported headers:
Forwarded (“for=”), X-Forwarded-For
X-Client-IP Client-IP, X-Real-IP
CF-Connecting-IP, True-Client-IP
Or using HaProxy protocol.
Sourcepub fn unset_forward(&mut self) -> &mut Self
pub fn unset_forward(&mut self) -> &mut Self
maybe enable support for one of the following “forward” headers or protocols
Supported headers:
Forwarded (“for=”), X-Forwarded-For
X-Client-IP Client-IP, X-Real-IP
CF-Connecting-IP, True-Client-IP
Or using HaProxy protocol.
Sourcepub fn maybe_with_tls_server_config(self, cfg: Option<ServerConfig>) -> Self
Available on crate features rustls or boring only.
pub fn maybe_with_tls_server_config(self, cfg: Option<ServerConfig>) -> Self
rustls or boring only.define a tls server cert config to be used for tls terminaton by the IP service.
Sourcepub fn maybe_set_tls_server_config(
&mut self,
cfg: Option<ServerConfig>,
) -> &mut Self
Available on crate features rustls or boring only.
pub fn maybe_set_tls_server_config( &mut self, cfg: Option<ServerConfig>, ) -> &mut Self
rustls or boring only.define a tls server cert config to be used for tls terminaton by the IP service.
Sourcepub fn with_tls_server_config(self, cfg: ServerConfig) -> Self
Available on crate features rustls or boring only.
pub fn with_tls_server_config(self, cfg: ServerConfig) -> Self
rustls or boring only.define a tls server cert config to be used for tls terminaton by the IP service.
Sourcepub fn set_tls_server_config(&mut self, cfg: ServerConfig) -> &mut Self
Available on crate features rustls or boring only.
pub fn set_tls_server_config(&mut self, cfg: ServerConfig) -> &mut Self
rustls or boring only.define a tls server cert config to be used for tls terminaton by the IP service.
Sourcepub fn without_tls_server_config(self) -> Self
Available on crate features rustls or boring only.
pub fn without_tls_server_config(self) -> Self
rustls or boring only.define a tls server cert config to be used for tls terminaton by the IP service.
Sourcepub fn unset_tls_server_config(&mut self) -> &mut Self
Available on crate features rustls or boring only.
pub fn unset_tls_server_config(&mut self) -> &mut Self
rustls or boring only.define a tls server cert config to be used for tls terminaton by the IP service.
Source§impl IpServiceBuilder<Http>
impl IpServiceBuilder<Http>
Trait Implementations§
Source§impl<M: Clone> Clone for IpServiceBuilder<M>
impl<M: Clone> Clone for IpServiceBuilder<M>
Source§fn clone(&self) -> IpServiceBuilder<M>
fn clone(&self) -> IpServiceBuilder<M>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<M> Freeze for IpServiceBuilder<M>
impl<M> !RefUnwindSafe for IpServiceBuilder<M>
impl<M> Send for IpServiceBuilder<M>
impl<M> Sync for IpServiceBuilder<M>
impl<M> Unpin for IpServiceBuilder<M>
impl<M> !UnwindSafe for IpServiceBuilder<M>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§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 more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more