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.

§Type Parameters

  • 'session - Borrow of the parent composer’s unpublished transaction.

§Examples

use qubit_redact::Redactor;

let output = Redactor::standard().text_composer().http(|http| {
    http.url("https://example.test/?password=raw-secret");
}).finish();
assert!(!output.text().as_str().contains("raw-secret"));

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.

§Parameters
  • value - URL text whose root, input bytes, and query structure must pass shared admission before rendering.
§Returns

This writer after recording safe output and diagnostic facts.

Source

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

Redacts headers into the parent session’s aggregate output.

§Parameters
  • headers - Borrowed headers, including native sensitive-value flags. The entire collection must pass shared admission before rendering.
§Returns

This writer after appending the admitted collection or recording why it could not be rendered.

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 skips the renderer. Successful admission appends bounded output. Actual output rejection closes later operations; source truncation alone leaves any remaining output allowance usable.

§Parameters
  • capture - Captured body bytes and optional source-length metadata.
  • content_type - Parsed header value used to select body handling, or None to use the format’s inference and fallback rules.
§Returns

This HTTP writer for further operations in the same transaction.

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 skips the renderer. Successful admission appends bounded output. Actual output rejection closes later operations; source truncation alone leaves any remaining output allowance usable.

§Parameters
  • capture - Captured body bytes and optional source-length metadata.
  • content_type - Text media type used to select body handling, or None to use the format’s inference and fallback rules.
§Returns

This HTTP writer for further operations in the same transaction.

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.