pub struct HttpDebugger { /* private fields */ }Expand description
HTTP traffic logger
Implementations§
Source§impl HttpDebugger
impl HttpDebugger
Sourcepub fn new(config: DebugConfig) -> Self
pub fn new(config: DebugConfig) -> Self
Create a new HTTP debugger with the given configuration
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if debugging is enabled
Sourcepub async fn log_request(
&self,
method: &str,
url: &str,
headers: &HeaderMap,
body: Option<&str>,
) -> String
pub async fn log_request( &self, method: &str, url: &str, headers: &HeaderMap, body: Option<&str>, ) -> String
Log a request (before sending)
Sourcepub async fn log_response(
&self,
request_id: &str,
status: u16,
headers: &HeaderMap,
body: Option<&str>,
duration_ms: u64,
)
pub async fn log_response( &self, request_id: &str, status: u16, headers: &HeaderMap, body: Option<&str>, duration_ms: u64, )
Log a response
Sourcepub async fn get_traffic(&self) -> Vec<TrafficEntry>
pub async fn get_traffic(&self) -> Vec<TrafficEntry>
Get all captured traffic entries
Trait Implementations§
Source§impl Debug for HttpDebugger
impl Debug for HttpDebugger
Auto Trait Implementations§
impl !Freeze for HttpDebugger
impl !RefUnwindSafe for HttpDebugger
impl Send for HttpDebugger
impl Sync for HttpDebugger
impl Unpin for HttpDebugger
impl !UnwindSafe for HttpDebugger
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