Struct HaProxyService
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§
§impl<S> HaProxyService<S>
impl<S> HaProxyService<S>
pub const fn new(inner: S) -> HaProxyService<S>
pub const fn new(inner: S) -> HaProxyService<S>
Create a new HaProxyService
with the given inner service.
pub fn with_peek(self, value: bool) -> HaProxyService<S>
pub fn with_peek(self, value: bool) -> HaProxyService<S>
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).
pub fn set_peek(&mut self, value: bool) -> &mut HaProxyService<S>
pub fn set_peek(&mut self, value: bool) -> &mut HaProxyService<S>
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).
Trait Implementations§
§impl<S> Clone for HaProxyService<S>where
S: Clone,
impl<S> Clone for HaProxyService<S>where
S: Clone,
§fn clone(&self) -> HaProxyService<S>
fn clone(&self) -> HaProxyService<S>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl<S> Debug for HaProxyService<S>where
S: Debug,
impl<S> Debug for HaProxyService<S>where
S: Debug,
§impl<S, IO> Service<IO> for HaProxyService<S>where
S: Service<PeekStream<HeapReader, IO>>,
<S as Service<PeekStream<HeapReader, IO>>>::Error: Into<Box<dyn Error + Sync + Send>>,
IO: Stream + Unpin,
impl<S, IO> Service<IO> for HaProxyService<S>where
S: Service<PeekStream<HeapReader, IO>>,
<S as Service<PeekStream<HeapReader, IO>>>::Error: Into<Box<dyn Error + Sync + Send>>,
IO: Stream + Unpin,
§type Response = <S as Service<PeekStream<HeapReader, IO>>>::Response
type Response = <S as Service<PeekStream<HeapReader, IO>>>::Response
§async fn serve(
&self,
ctx: Context,
stream: IO,
) -> Result<<HaProxyService<S> as Service<IO>>::Response, <HaProxyService<S> as Service<IO>>::Error>
async fn serve( &self, ctx: Context, stream: IO, ) -> Result<<HaProxyService<S> as Service<IO>>::Response, <HaProxyService<S> as Service<IO>>::Error>
§fn boxed(self) -> BoxService<Request, Self::Response, Self::Error>
fn boxed(self) -> BoxService<Request, Self::Response, Self::Error>
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> UnwindSafe for HaProxyService<S>where
S: UnwindSafe,
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<S, Request, Connection> ConnectorService<Request> for S
impl<S, Request, Connection> ConnectorService<Request> for S
§type Connection = Connection
type Connection = Connection
ConnectorService
§fn connect(
&self,
ctx: Context,
req: Request,
) -> impl Future<Output = Result<EstablishedClientConnection<<S as ConnectorService<Request>>::Connection, Request>, <S as ConnectorService<Request>>::Error>> + Send
fn connect( &self, ctx: Context, req: Request, ) -> impl Future<Output = Result<EstablishedClientConnection<<S as ConnectorService<Request>>::Connection, Request>, <S as ConnectorService<Request>>::Error>> + Send
§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