pub struct NetworkTraceHandle { /* private fields */ }Expand description
Builder for manual network request instrumentation. Mirrors the JS
NetworkRequestTrace helper and records timing plus payload metadata.
Implementations§
Source§impl NetworkTraceHandle
impl NetworkTraceHandle
Sourcepub fn start(&mut self) -> PerformanceResult<()>
pub fn start(&mut self) -> PerformanceResult<()>
Marks the beginning of the manual network request measurement.
Sourcepub fn mark_response_initiated(&mut self) -> PerformanceResult<()>
pub fn mark_response_initiated(&mut self) -> PerformanceResult<()>
Records when the response headers have been received.
Sourcepub fn set_request_payload_bytes(&mut self, bytes: u64)
pub fn set_request_payload_bytes(&mut self, bytes: u64)
Annotates the request payload size.
Sourcepub fn set_response_payload_bytes(&mut self, bytes: u64)
pub fn set_response_payload_bytes(&mut self, bytes: u64)
Annotates the response payload size.
Sourcepub fn set_response_code(&mut self, code: u16) -> PerformanceResult<()>
pub fn set_response_code(&mut self, code: u16) -> PerformanceResult<()>
Stores the final HTTP response code.
Sourcepub fn set_response_content_type(&mut self, content_type: impl Into<String>)
pub fn set_response_content_type(&mut self, content_type: impl Into<String>)
Stores the response Content-Type header (if known).
Sourcepub async fn stop(self) -> PerformanceResult<NetworkRequestRecord>
pub async fn stop(self) -> PerformanceResult<NetworkRequestRecord>
Completes the network trace, returning the recorded timings.
Trait Implementations§
Source§impl Clone for NetworkTraceHandle
impl Clone for NetworkTraceHandle
Source§fn clone(&self) -> NetworkTraceHandle
fn clone(&self) -> NetworkTraceHandle
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for NetworkTraceHandle
impl !RefUnwindSafe for NetworkTraceHandle
impl Send for NetworkTraceHandle
impl Sync for NetworkTraceHandle
impl Unpin for NetworkTraceHandle
impl !UnwindSafe for NetworkTraceHandle
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