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>
impl<'session> HttpRedactionWriter<'session>
Sourcepub fn headers(&mut self, headers: &HeaderMap) -> &mut Self
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>
impl<'session> HttpRedactionWriter<'session>
Sourcepub fn body(
&mut self,
capture: BodyCapture<'_>,
content_type: Option<&HeaderValue>,
) -> &mut Self
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, orNoneto use the format’s inference and fallback rules.
§Returns
This HTTP writer for further operations in the same transaction.
Sourcepub fn body_with_content_type_text(
&mut self,
capture: BodyCapture<'_>,
content_type: Option<&str>,
) -> &mut Self
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, orNoneto use the format’s inference and fallback rules.
§Returns
This HTTP writer for further operations in the same transaction.