pub struct SensitiveHeaders<'a, F> { /* private fields */ }
Expand description
A wrapper around &HeaderMap
which modifies the behavior of Debug
. Specific parts of the
HeaderMap
are marked as sensitive using a closure. This accommodates the httpPrefixHeaders trait and
httpHeader trait.
The Debug
implementation will respect the unredacted-logging
flag.
§Example
// Headers with keys equal to "header-name" are sensitive
let marker = |key|
HeaderMarker {
value: key == "header-name",
key_suffix: None
};
let headers = SensitiveHeaders::new(&headers, marker);
println!("{headers:?}");
Implementations§
source§impl<'a, F> SensitiveHeaders<'a, F>
impl<'a, F> SensitiveHeaders<'a, F>
sourcepub fn new(headers: &'a HeaderMap, marker: F) -> Self
pub fn new(headers: &'a HeaderMap, marker: F) -> Self
Constructs a new SensitiveHeaders
.
Trait Implementations§
source§impl<'a, F> Debug for SensitiveHeaders<'a, F>
impl<'a, F> Debug for SensitiveHeaders<'a, F>
Auto Trait Implementations§
impl<'a, F> Freeze for SensitiveHeaders<'a, F>where
F: Freeze,
impl<'a, F> RefUnwindSafe for SensitiveHeaders<'a, F>where
F: RefUnwindSafe,
impl<'a, F> Send for SensitiveHeaders<'a, F>where
F: Send,
impl<'a, F> Sync for SensitiveHeaders<'a, F>where
F: Sync,
impl<'a, F> Unpin for SensitiveHeaders<'a, F>where
F: Unpin,
impl<'a, F> UnwindSafe for SensitiveHeaders<'a, F>where
F: 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
§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>
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 moreCreates a shared type from an unshared type.