pub struct IpServiceBuilder<M> { /* private fields */ }
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 HTTP.
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 concurrent(self, limit: usize) -> Self
pub fn concurrent(self, limit: usize) -> Self
set the number of concurrent connections to allow
(0 = no limit)
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
(0 = no limit)
Sourcepub fn timeout(self, timeout: Duration) -> Self
pub fn timeout(self, timeout: Duration) -> Self
set the timeout in seconds for each connection
(0 = no timeout)
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
(0 = no timeout)
Sourcepub fn forward(self, kind: ForwardKind) -> Self
pub fn forward(self, kind: ForwardKind) -> Self
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, kind: ForwardKind) -> &mut Self
pub fn set_forward(&mut self, kind: ForwardKind) -> &mut Self
enable support for one of the following “forward” headers or protocols
Same as Self::forward
but without consuming self
.
Sourcepub fn maybe_forward(self, maybe_kind: Option<ForwardKind>) -> Self
pub fn maybe_forward(self, maybe_kind: Option<ForwardKind>) -> Self
maybe enable support for one of the following “forward” headers or protocols.
See Self::forward
for more information.
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 moreSource§impl<M: Debug> Debug for IpServiceBuilder<M>
impl<M: Debug> Debug for IpServiceBuilder<M>
Auto 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