Skip to main content

HttpRedactionWriter

Struct HttpRedactionWriter 

Source
pub struct HttpRedactionWriter<'session> { /* private fields */ }
Expand description

Feature-gated HTTP operations sharing one mutable diagnostic session.

Implementations§

Source§

impl<'session> HttpRedactionWriter<'session>

Source

pub fn url(&mut self, value: &str) -> &mut Self

Redacts a URL string into the parent session’s aggregate output.

Source

pub fn headers(&mut self, headers: &HeaderMap) -> &mut Self

Redacts headers into the parent session’s aggregate output.

Source§

impl<'session> HttpRedactionWriter<'session>

Source

pub fn body( &mut self, capture: BodyCapture<'_>, content_type: Option<&HeaderValue>, ) -> &mut Self

Redacts a captured HTTP body into the parent session’s aggregate output.

Body and content-type byte lengths are offered to the shared budget before the body renderer inspects their contents. Rejected input emits a non-empty diagnostic fallback when it fits; exhausted output returns empty text and does not invoke the renderer. Successful admission commits only the bounded output and closes the session when the body or session budget omits content.

§Parameters
  • capture - Captured body bytes and optional source-length metadata.
  • content_type - Parsed header value used to select body handling.
§Returns

A bounded body result with completion and capture metadata.

Source

pub fn body_with_content_type_text( &mut self, capture: BodyCapture<'_>, content_type: Option<&str>, ) -> &mut Self

Redacts a captured HTTP body with text Content-Type.

Body and content-type byte lengths are offered to the shared budget before the body renderer inspects their contents. Rejected input emits a non-empty diagnostic fallback when it fits; exhausted output returns empty text and does not invoke the renderer. Successful admission commits only the bounded output and closes the session when the body or session budget omits content.

§Parameters
  • capture - Captured body bytes and optional source-length metadata.
  • content_type - Text media type used to select body handling.
§Returns

A bounded body result with completion and capture metadata.

Auto Trait Implementations§

§

impl<'session> !UnwindSafe for HttpRedactionWriter<'session>

§

impl<'session> Freeze for HttpRedactionWriter<'session>

§

impl<'session> RefUnwindSafe for HttpRedactionWriter<'session>

§

impl<'session> Send for HttpRedactionWriter<'session>

§

impl<'session> Sync for HttpRedactionWriter<'session>

§

impl<'session> Unpin for HttpRedactionWriter<'session>

§

impl<'session> UnsafeUnpin for HttpRedactionWriter<'session>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.