pub struct MetricsHeaderLimits { /* private fields */ }Expand description
Maximum accepted byte lengths for metrics-related forwarding headers.
Implementations§
Source§impl MetricsHeaderLimits
impl MetricsHeaderLimits
Sourcepub const DEFAULT_FORWARDED_HEADER_VALUE_BYTES: usize = 2048
pub const DEFAULT_FORWARDED_HEADER_VALUE_BYTES: usize = 2048
Default max byte length for the standard Forwarded header.
Sourcepub const DEFAULT_X_FORWARDED_FOR_HEADER_VALUE_BYTES: usize = 2048
pub const DEFAULT_X_FORWARDED_FOR_HEADER_VALUE_BYTES: usize = 2048
Default max byte length for X-Forwarded-For.
Sourcepub const DEFAULT_X_REAL_IP_HEADER_VALUE_BYTES: usize = 512
pub const DEFAULT_X_REAL_IP_HEADER_VALUE_BYTES: usize = 512
Default max byte length for X-Real-IP.
Sourcepub const DEFAULT_AUTHORIZATION_HEADER_VALUE_BYTES: usize = 2048
pub const DEFAULT_AUTHORIZATION_HEADER_VALUE_BYTES: usize = 2048
Default max byte length for Authorization.
Sourcepub fn new(
forwarded_header_value_bytes: usize,
x_forwarded_for_header_value_bytes: usize,
x_real_ip_header_value_bytes: usize,
) -> Result<Self, HttpError>
pub fn new( forwarded_header_value_bytes: usize, x_forwarded_for_header_value_bytes: usize, x_real_ip_header_value_bytes: usize, ) -> Result<Self, HttpError>
Create a custom header limit set. All values must be greater than zero.
Create a custom header limit set including Authorization.
All values must be greater than zero.
Sourcepub const fn forwarded_header_value_bytes(self) -> usize
pub const fn forwarded_header_value_bytes(self) -> usize
Max byte length for Forwarded.
Sourcepub const fn x_forwarded_for_header_value_bytes(self) -> usize
pub const fn x_forwarded_for_header_value_bytes(self) -> usize
Max byte length for X-Forwarded-For.
Sourcepub const fn x_real_ip_header_value_bytes(self) -> usize
pub const fn x_real_ip_header_value_bytes(self) -> usize
Max byte length for X-Real-IP.
Max byte length for Authorization.
Trait Implementations§
Source§impl Clone for MetricsHeaderLimits
impl Clone for MetricsHeaderLimits
Source§fn clone(&self) -> MetricsHeaderLimits
fn clone(&self) -> MetricsHeaderLimits
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for MetricsHeaderLimits
Source§impl Debug for MetricsHeaderLimits
impl Debug for MetricsHeaderLimits
Source§impl Default for MetricsHeaderLimits
impl Default for MetricsHeaderLimits
impl Eq for MetricsHeaderLimits
Source§impl PartialEq for MetricsHeaderLimits
impl PartialEq for MetricsHeaderLimits
impl StructuralPartialEq for MetricsHeaderLimits
Auto Trait Implementations§
impl Freeze for MetricsHeaderLimits
impl RefUnwindSafe for MetricsHeaderLimits
impl Send for MetricsHeaderLimits
impl Sync for MetricsHeaderLimits
impl Unpin for MetricsHeaderLimits
impl UnsafeUnpin for MetricsHeaderLimits
impl UnwindSafe for MetricsHeaderLimits
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn compression(self) -> Compression<Self>where
Self: Sized,
fn compression(self) -> Compression<Self>where
Self: Sized,
Available on crate features
compression-br or compression-deflate or compression-gzip or compression-zstd only.Compresses response bodies. Read more
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
Available on crate feature
trace only.High level tracing that classifies responses using HTTP status codes. Read more
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
Available on crate feature
trace only.High level tracing that classifies responses using gRPC headers. Read more
Source§fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
Available on crate feature
follow-redirect only.Source§fn set_request_id<M>(
self,
header_name: HeaderName,
make_request_id: M,
) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
fn set_request_id<M>(
self,
header_name: HeaderName,
make_request_id: M,
) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
Available on crate feature
request-id only.Add request id header and extension. Read more
Source§fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
Available on crate feature
request-id only.Add request id header and extension, using
x-request-id as the header name. Read moreSource§fn propagate_request_id(
self,
header_name: HeaderName,
) -> PropagateRequestId<Self>where
Self: Sized,
fn propagate_request_id(
self,
header_name: HeaderName,
) -> PropagateRequestId<Self>where
Self: Sized,
Available on crate feature
request-id only.Propgate request ids from requests to responses. Read more
Source§fn propagate_x_request_id(self) -> PropagateRequestId<Self>where
Self: Sized,
fn propagate_x_request_id(self) -> PropagateRequestId<Self>where
Self: Sized,
Available on crate feature
request-id only.Propgate request ids from requests to responses, using
x-request-id as the header name. Read more