Skip to main content

with_page_session

Function with_page_session 

Source
pub async fn with_page_session<T, F, Fut>(
    client: &CdpClient,
    target_id: &str,
    timeout: Duration,
    f: F,
) -> Result<T>
where F: FnOnce(String) -> Fut, Fut: Future<Output = Result<T>>,
Expand description

Attach to target_id, run f(session_id) bounded by timeout with crash detection, then detach. Detach is best-effort: the target may already be gone, and the caller’s result is what matters.