pub struct BodyLogger { /* private fields */ }Available on crate feature
std only.Expand description
Appends request bodies and streamed response chunks to a file.
Clones share the same file. Writes are synchronous and best-effort: log failures do not interrupt proxy responses.
Implementations§
Source§impl BodyLogger
impl BodyLogger
Sourcepub fn open(path: &Path) -> Result<Self>
pub fn open(path: &Path) -> Result<Self>
Appends to a log, creating new files with mode 0600 on Unix.
Sourcepub fn log_request_body(&self, data: &[u8])
pub fn log_request_body(&self, data: &[u8])
Logs a complete (buffered) request body.
Sourcepub fn log_response_chunk(&self, data: &[u8])
pub fn log_response_chunk(&self, data: &[u8])
Logs a single chunk of a (possibly streamed) response body.
Trait Implementations§
Auto Trait Implementations§
impl Forget for BodyLogger
impl Freeze for BodyLogger
impl Move for BodyLogger
impl RefUnwindSafe for BodyLogger
impl Send for BodyLogger
impl Sync for BodyLogger
impl Unpin for BodyLogger
impl UnsafeUnpin for BodyLogger
impl UnwindSafe for BodyLogger
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<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> 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 more