pub struct Tracing { /* private fields */ }Expand description
A performance tracing handle for a BrowserContext.
Cheaply cloneable; all clones share the same underlying state (the browser session, an optional output path, and a started flag).
Implementations§
Source§impl Tracing
impl Tracing
Sourcepub async fn start(&self, options: Option<TracingStartOptions>) -> Result<()>
pub async fn start(&self, options: Option<TracingStartOptions>) -> Result<()>
Begin capturing a trace.
Subscribes to the browser session’s event stream before issuing
Tracing.start so the later Tracing.tracingComplete event is not
missed.
Sourcepub async fn stop(&self) -> Result<Vec<u8>>
pub async fn stop(&self) -> Result<Vec<u8>>
Stop the in-progress trace and return the full trace as JSON bytes.
Sends Tracing.end, awaits Tracing.tracingComplete (which carries the
stream handle), then drains the stream with IO.read until eof. If a
path was recorded on start, the bytes are also written there.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Tracing
impl !UnwindSafe for Tracing
impl Freeze for Tracing
impl Send for Tracing
impl Sync for Tracing
impl Unpin for Tracing
impl UnsafeUnpin for Tracing
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