pub struct ProxyAuthLayer<A, C, L = ()> { /* private fields */ }Expand description
Layer that applies the ProxyAuthService middleware which apply a timeout to requests.
See the module docs for an example.
Implementations§
Source§impl<A, C> ProxyAuthLayer<A, C, ()>
impl<A, C> ProxyAuthLayer<A, C, ()>
Sourcepub const fn new(proxy_auth: A) -> Self
pub const fn new(proxy_auth: A) -> Self
Creates a new ProxyAuthLayer.
Sourcepub fn set_allow_anonymous(&mut self, allow_anonymous: bool) -> &mut Self
pub fn set_allow_anonymous(&mut self, allow_anonymous: bool) -> &mut Self
Allow anonymous requests.
Sourcepub fn with_allow_anonymous(self, allow_anonymous: bool) -> Self
pub fn with_allow_anonymous(self, allow_anonymous: bool) -> Self
Allow anonymous requests.
Source§impl<A, C, L> ProxyAuthLayer<A, C, L>
impl<A, C, L> ProxyAuthLayer<A, C, L>
Sourcepub fn with_labels<L2>(self) -> ProxyAuthLayer<A, C, L2>
pub fn with_labels<L2>(self) -> ProxyAuthLayer<A, C, L2>
Overwrite the Labels extract type
This is used if the username contains labels that you need to extract out.
Example implementation is the UsernameOpaqueLabelParser.
You can provide your own extractor by implementing the UsernameLabelParser trait.
Trait Implementations§
Source§impl<A: Clone, C, L> Clone for ProxyAuthLayer<A, C, L>
impl<A: Clone, C, L> Clone for ProxyAuthLayer<A, C, L>
Source§impl<A: Debug, C, L> Debug for ProxyAuthLayer<A, C, L>
impl<A: Debug, C, L> Debug for ProxyAuthLayer<A, C, L>
Source§impl<A, C, L, S> Layer<S> for ProxyAuthLayer<A, C, L>
impl<A, C, L, S> Layer<S> for ProxyAuthLayer<A, C, L>
Source§type Service = ProxyAuthService<A, C, S, L>
type Service = ProxyAuthService<A, C, S, L>
The service produced by the layer.
Source§fn layer(&self, inner: S) -> Self::Service
fn layer(&self, inner: S) -> Self::Service
Wrap the given service with the middleware, returning a new service.
Source§fn into_layer(self, inner: S) -> Self::Service
fn into_layer(self, inner: S) -> Self::Service
Same as
layer but consuming self after the service was created. Read moreAuto Trait Implementations§
impl<A, C, L> Freeze for ProxyAuthLayer<A, C, L>where
A: Freeze,
impl<A, C, L> RefUnwindSafe for ProxyAuthLayer<A, C, L>where
A: RefUnwindSafe,
impl<A, C, L> Send for ProxyAuthLayer<A, C, L>where
A: Send,
impl<A, C, L> Sync for ProxyAuthLayer<A, C, L>where
A: Sync,
impl<A, C, L> Unpin for ProxyAuthLayer<A, C, L>where
A: Unpin,
impl<A, C, L> UnwindSafe for ProxyAuthLayer<A, C, L>where
A: 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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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