pub struct HaProxyService<S> { /* private fields */ }Expand description
Service to decode the HaProxy Protocol
This service will decode the HaProxy Protocol header and pass the decoded information to the inner service.
Implementations§
Source§impl<S> HaProxyService<S>
impl<S> HaProxyService<S>
Sourcepub const fn new(inner: S) -> Self
pub const fn new(inner: S) -> Self
Create a new HaProxyService with the given inner service.
Sourcepub fn with_peek(self, value: bool) -> Self
pub fn with_peek(self, value: bool) -> Self
Instruct HaProxyService to peek prior to comitting to the HaProxy protocol.
Doing so makes it possible to support traffic with or without the use of that data. This can be useful to run services locally (not behind a loadbalancer) as well as in the the cloud (production, behind a loadbalancer).
Sourcepub fn set_peek(&mut self, value: bool) -> &mut Self
pub fn set_peek(&mut self, value: bool) -> &mut Self
Instruct HaProxyService to peek prior to comitting to the HaProxy protocol.
Doing so makes it possible to support traffic with or without the use of that data. This can be useful to run services locally (not behind a loadbalancer) as well as in the the cloud (production, behind a loadbalancer).
Sourcepub fn with_strictness(self, value: HaProxyStrictness) -> Self
pub fn with_strictness(self, value: HaProxyStrictness) -> Self
Override the strictness configuration applied to incoming PROXY headers.
Sourcepub fn set_strictness(&mut self, value: HaProxyStrictness) -> &mut Self
pub fn set_strictness(&mut self, value: HaProxyStrictness) -> &mut Self
Override the strictness configuration applied to incoming PROXY headers.
Trait Implementations§
Source§impl<S: Clone> Clone for HaProxyService<S>
impl<S: Clone> Clone for HaProxyService<S>
Source§impl<S: Debug> Debug for HaProxyService<S>
impl<S: Debug> Debug for HaProxyService<S>
Source§impl<S, IO> Service<IO> for HaProxyService<S>where
S: Service<PrefixedIo<HeapReader, IO>, Error: Into<BoxError>>,
IO: Io + Unpin + ExtensionsRef,
impl<S, IO> Service<IO> for HaProxyService<S>where
S: Service<PrefixedIo<HeapReader, IO>, Error: Into<BoxError>>,
IO: Io + Unpin + ExtensionsRef,
Auto Trait Implementations§
impl<S> Freeze for HaProxyService<S>where
S: Freeze,
impl<S> RefUnwindSafe for HaProxyService<S>where
S: RefUnwindSafe,
impl<S> Send for HaProxyService<S>where
S: Send,
impl<S> Sync for HaProxyService<S>where
S: Sync,
impl<S> Unpin for HaProxyService<S>where
S: Unpin,
impl<S> UnsafeUnpin for HaProxyService<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for HaProxyService<S>where
S: UnwindSafe,
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<S, Input, Connection> ConnectorService<Input> for Swhere
S: Service<Input, Output = EstablishedClientConnection<Connection, Input>>,
<S as Service<Input>>::Error: Into<ConnectionError>,
Connection: Send + ExtensionsRef,
impl<S, Input, Connection> ConnectorService<Input> for Swhere
S: Service<Input, Output = EstablishedClientConnection<Connection, Input>>,
<S as Service<Input>>::Error: Into<ConnectionError>,
Connection: Send + ExtensionsRef,
Source§type Connection = Connection
type Connection = Connection
ConnectorServiceSource§fn connect(
&self,
input: Input,
) -> impl Future<Output = Result<EstablishedClientConnection<<S as ConnectorService<Input>>::Connection, Input>, ConnectionError>> + Send
fn connect( &self, input: Input, ) -> impl Future<Output = Result<EstablishedClientConnection<<S as ConnectorService<Input>>::Connection, Input>, ConnectionError>> + Send
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 more