Page

Struct Page 

Source
pub struct Page {
    pub contexts: Arc<Mutex<HashMap<String, u32>>>,
    pub domain_manager: Arc<DomainManager>,
    pub network_monitor: Arc<NetworkMonitor>,
    pub response_monitor_manager: Arc<ResponseMonitorManager>,
    /* private fields */
}

Fields§

§contexts: Arc<Mutex<HashMap<String, u32>>>

Frame ID -> Execution Context ID mapping

§domain_manager: Arc<DomainManager>

Domain manager (unified management of CDP Domain enabling/disabling)

§network_monitor: Arc<NetworkMonitor>

Network monitor

§response_monitor_manager: Arc<ResponseMonitorManager>

Response monitor manager

Implementations§

Source§

impl Page

Response monitoring convenience methods

Source

pub async fn monitor_responses<F, H>( self: &Arc<Self>, filter: F, handler: H, ) -> Result<()>
where F: Fn(&str) -> bool + Send + Sync + 'static, H: Fn(&InterceptedResponse) + Send + Sync + 'static,

Registers a non-blocking handler for all responses that pass the filter.

§Parameters
  • filter - Returns true when a response should be forwarded to the handler.
  • handler - Receives the captured response metadata.
§Examples
page.monitor_responses(
    |url| url.contains("/api/"),
    |response| {
        println!("API Response: {} - {}", response.status_code, response.status_text);
        if let Some(body) = &response.body {
            println!("Body: {}", body);
        }
    },
).await?;
Source

pub async fn monitor_responses_matching<H>( self: &Arc<Self>, url_pattern: &str, handler: H, ) -> Result<()>
where H: Fn(&InterceptedResponse) + Send + Sync + 'static,

Registers a handler for responses whose URLs contain the given pattern.

§Parameters
  • url_pattern - Substring that must be present in the URL.
  • handler - Invoked with the captured response metadata.
§Examples
page.monitor_responses_matching(
    "data.json",
    |response| {
        println!("Data Response: {}", response.status_code);
    },
).await?;
Source

pub async fn stop_response_monitoring(self: &Arc<Self>) -> Result<()>

Removes all registered response monitors.

§Examples
page.stop_response_monitoring().await?;
Source§

impl Page

Source

pub async fn connect_to_active_page( port: Option<u16>, pattern: Option<&str>, ) -> Result<Arc<Self>>

Mode 2 entry: Connect directly

Source

pub async fn connect_to_active_page_with_browser( port: Option<u16>, pattern: Option<&str>, browser_process: Option<&str>, ) -> Result<Arc<Self>>

Mode 2 entry: Connect directly (supports custom browser process)

Source

pub fn mouse(&self) -> Mouse

Get mouse controller

Source

pub fn keyboard(&self) -> Keyboard

Get keyboard controller

Source

pub fn accessibility(self: &Arc<Self>) -> AccessibilityController

Source

pub fn emulation(self: &Arc<Self>) -> EmulationController

Source

pub fn tracing(self: &Arc<Self>) -> TracingController

Source

pub async fn navigate(&self, url: &str) -> Result<NavigateReturnObject>

Source

pub fn on<E>(&self) -> Pin<Box<dyn Stream<Item = E> + Send + 'static>>
where E: TryFrom<CdpEvent> + Send + 'static, <E as TryFrom<CdpEvent>>::Error: Send,

Source

pub async fn wait_for_loaded(&self) -> Result<LoadEventFiredEvent>

Source

pub async fn get_title(&self) -> Result<String>

Source

pub async fn main_frame(self: &Arc<Self>) -> Result<Frame>

Get main Frame (cached)

Source

pub async fn query_selector( self: &Arc<Self>, selector: &str, ) -> Result<Option<ElementHandle>>

Queries the first element matching the CSS selector.

This method automatically searches across all frames (including iframes):

  1. First searches in the main frame
  2. If not found, searches in all child frames
§Parameters
  • selector - CSS selector string
§Returns

First matching element handle, or None if no match

§Examples
// Automatically search for first matching button in all frames
if let Some(button) = page.query_selector(".submit-btn").await? {
    button.click().await?;
}
Source

pub async fn query_selector_all( self: &Arc<Self>, selector: &str, ) -> Result<Vec<ElementHandle>>

Queries all elements matching the CSS selector.

This method automatically searches across all frames (including iframes):

  1. First searches in the main frame
  2. Then searches in all child frames and collects all matches
§Parameters
  • selector - CSS selector string
§Returns

List of all matching element handles, or empty list if no match

§Examples
// Automatically search for all matching links in all frames
let links = page.query_selector_all("a").await?;
println!("Found {} links across all frames", links.len());

for (i, link) in links.iter().enumerate() {
    let href = link.get_attribute("href").await?;
    println!("Link {}: {:?}", i + 1, href);
}
Source

pub async fn all_frames(self: &Arc<Self>) -> Result<Vec<Frame>>

Returns a flat list of all frames attached to this page.

Source

pub async fn get_frame(&self, frame_id: &str) -> Option<Frame>

Get Frame by ID (from cache)

Source

pub async fn clear_frame_cache(&self)

Clear Frame cache (called after navigation)

Source

pub async fn register_execution_context( &self, frame_id: String, context_id: u32, )

Register Execution Context (called by event handler)

Source

pub async fn remove_execution_context(&self, context_id: u32)

Remove specified Execution Context (called by event handler)

Source

pub async fn clear_execution_contexts(&self)

Clear all Execution Contexts (called by event handler)

Source

pub async fn get_parent_frame(&self, frame_id: &str) -> Option<Frame>

Get parent Frame of specified Frame

Source

pub async fn get_child_frames(&self, frame_id: &str) -> Vec<Frame>

Get all child Frames of specified Frame

Source

pub async fn get_ancestor_frames(&self, frame_id: &str) -> Vec<Frame>

Get all ancestor Frames of specified Frame (from near to far)

Source

pub async fn get_descendant_frames(&self, frame_id: &str) -> Vec<Frame>

Get all descendant Frames of specified Frame (DFS)

Source

pub async fn query_frame( self: &Arc<Self>, selector: &str, ) -> Result<Option<Frame>>

Find Frame by selector

§Selector Syntax
  • name:iframe-name - Match by name
  • url:https://example.com - Match by URL prefix
  • url~pattern - Match by URL regex
  • depth:2 - Match by depth (0 = Main Frame, 1 = Direct Child Frame)
§Examples
// Find Frame named "login-iframe"
if let Some(frame) = page.query_frame("name:login-iframe").await? {
    println!("Found iframe: {}", frame.id());
}

// Find Frame with URL containing "checkout"
if let Some(frame) = page.query_frame("url~checkout").await? {
    println!("Found checkout frame: {}", frame.id());
}
Source

pub async fn query_frames( self: &Arc<Self>, selector: &str, ) -> Result<Vec<Frame>>

Find all Frames matching selector

Source

pub async fn on_frame_lifecycle(&self, callback: FrameLifecycleCallback)

Register Frame lifecycle callback

§Examples
use cdp_core::{Page, FrameLifecycleEvent};
use std::sync::Arc;

page.on_frame_lifecycle(Arc::new(|event| {
    match event {
        FrameLifecycleEvent::Attached { frame_id, parent_frame_id } => {
            println!("Frame attached: {}", frame_id);
        }
        FrameLifecycleEvent::Detached { frame_id } => {
            println!("Frame detached: {}", frame_id);
        }
        FrameLifecycleEvent::Navigated { frame_id, url } => {
            println!("Frame navigated: {} to {}", frame_id, url);
        }
    }
})).await;
Source

pub async fn on_dom_mutation(&self, callback: DomMutationCallback)

Register DOM mutation callback

§Examples
use cdp_core::{Page, DomMutationEvent};
use std::sync::Arc;

// Enable DOM monitoring
page.enable_dom_mutations().await?;

// Register callback
page.on_dom_mutation(Arc::new(|event| {
    match event {
        DomMutationEvent::ChildNodeInserted { parent_node_id, .. } => {
            println!("Child node inserted into {}", parent_node_id);
        }
        DomMutationEvent::AttributeModified { node_id, name, value } => {
            println!("Attribute {} = {} on node {}", name, value, node_id);
        }
        _ => {}
    }
})).await;
Source

pub async fn enable_dom_mutations(&self) -> Result<()>

Enable DOM mutation monitoring

Source§

impl Page

Source

pub async fn create_frame_snapshot( &self, frame_id: &str, include_html: bool, ) -> Result<FrameSnapshot>

Create Frame snapshot

§Arguments
  • frame_id - Frame ID
  • include_html - Whether to include HTML content
§Examples
let main_frame = page.main_frame().await?;

// Create snapshot (without HTML)
let snapshot = page.create_frame_snapshot(&main_frame.id, false).await?;
println!("Snapshot: {:?}", snapshot);

// Create snapshot (with HTML)
let snapshot_with_html = page.create_frame_snapshot(&main_frame.id, true).await?;
println!("HTML length: {}", snapshot_with_html.html_content.as_ref().map(|s| s.len()).unwrap_or(0));
Source

pub async fn create_all_frames_snapshot( self: &Arc<Self>, include_html: bool, ) -> Result<Vec<FrameSnapshot>>

Create snapshots for all Frames

§Examples
let snapshots = page.create_all_frames_snapshot(false).await?;
println!("Created {} snapshots", snapshots.len());

// Save as JSON
let json = serde_json::to_string_pretty(&snapshots)?;
std::fs::write("frame_snapshots.json", json)?;
Source

pub fn compare_snapshots( snapshot1: &FrameSnapshot, snapshot2: &FrameSnapshot, ) -> Vec<String>

Compare differences between two snapshots

§Examples
let snapshot1 = page.create_all_frames_snapshot(false).await?;

// Wait for some changes...
tokio::time::sleep(tokio::time::Duration::from_secs(1)).await;

let snapshot2 = page.create_all_frames_snapshot(false).await?;

for (snap1, snap2) in snapshot1.iter().zip(snapshot2.iter()) {
    let diff = Page::compare_snapshots(snap1, snap2);
    println!("Frame {}: {} changes", snap1.frame_id, diff.len());
}
Source

pub async fn type_text(&self, text: &str) -> Result<()>

Type text into current focused element (insert all text at once)

This method uses CDP’s Input.insertText command to insert all text at once. Suitable for fast input, but does not simulate real user character-by-character input.

§Parameters
  • text - Text to type
§Examples
// Focus on input box first
if let Some(input) = page.query_selector("input[type='text']").await? {
    input.click().await?;
}

// Fast type text
page.type_text("Hello, World!").await?;
Source

pub async fn type_text_with_delay( &self, text: &str, min_delay_ms: u64, max_delay_ms: u64, ) -> Result<()>

Type text into current focused element character by character, with random delay between each character

This method simulates real user input behavior, each character triggers keyDown, keyUp events. Delay time is randomly generated within [min_delay_ms, max_delay_ms].

§Parameters
  • text - Text to type
  • min_delay_ms - Minimum delay (ms)
  • max_delay_ms - Maximum delay (ms)
§Examples
// Focus on input box first
if let Some(input) = page.query_selector("input[type='text']").await? {
    input.click().await?;
}

// Type with random delay
page.type_text_with_delay("Hello, World!", 50, 150).await?;
Source

pub async fn screenshot( &self, full_page: bool, save_path: Option<PathBuf>, ) -> Result<String>

Takes a screenshot of the page.

Takes a screenshot of the page.

§Parameters
  • full_page - Whether to capture full page (including scroll area). If false, only capture current viewport
  • save_path - Optional save path (including filename). If None, save to current directory with name screenshot_timestamp.png
§Returns

Saved file path

§Examples
// Capture current viewport and save automatically
let path = page.screenshot(false, None).await?;
println!("Screenshot saved to: {}", path);

// Capture full page and save to specified path
let path = page.screenshot(true, Some("screenshots/fullpage.png".into())).await?;
println!("Full page screenshot saved to: {}", path);
Source

pub async fn screenshot_with_options( &self, full_page: bool, save_path: Option<PathBuf>, auto_resolve_dpr: bool, ) -> Result<String>

Takes a screenshot of the page with custom options.

Takes a screenshot of the page with custom options.

§Parameters
  • full_page - Whether to capture full page (including scroll area). If false, only capture current viewport
  • save_path - Optional save path (including filename). If None, save to current directory with name screenshot_timestamp.png
  • auto_resolve_dpr - Whether to automatically adapt to device pixel ratio. If true, automatically detect and use actual DPR to avoid screenshot being too large or distorted
§Returns

Saved file path

§Examples
// Capture full page, do not adapt DPR (use fixed 1.0, compatible with old behavior)
let path = page.screenshot_with_options(true, None, false).await?;

// Capture full page, adapt DPR (recommended, avoid screenshot being too large)
let path = page.screenshot_with_options(true, None, true).await?;
Source

pub async fn wait_for_selector( self: &Arc<Self>, selector: &str, options: Option<WaitForSelectorOptions>, ) -> Result<ElementHandle>

Wait for element matching selector to appear

§Parameters
  • selector - CSS selector or XPath expression
  • options - Wait options (timeout, visibility, etc.)
§Returns

Matching element handle

§Examples
// Wait for element to appear (default 30s timeout)
let button = page.wait_for_selector("#submit-btn", None).await?;

// Custom timeout and visibility requirements
let element = page.wait_for_selector(
    ".dynamic-content",
    Some(WaitForSelectorOptions {
        timeout_ms: Some(5000),
        visible: Some(true),
        hidden: Some(false),
    })
).await?;
Source

pub async fn wait_for_selector_hidden( self: &Arc<Self>, selector: &str, timeout_ms: Option<u64>, ) -> Result<()>

Wait for element matching selector to disappear or be hidden

§Parameters
  • selector - CSS selector or XPath expression
  • timeout_ms - Timeout in milliseconds, default 30000
§Examples
// Wait for loading spinner to disappear
page.wait_for_selector_hidden(".loading-spinner", None).await?;
Source

pub async fn wait_for_function( self: &Arc<Self>, function: &str, timeout_ms: Option<u64>, poll_interval_ms: Option<u64>, ) -> Result<()>

Wait for custom function to return true

§Parameters
  • function - JavaScript function string, should return boolean
  • timeout_ms - Timeout in milliseconds, default 30000
  • poll_interval_ms - Polling interval (ms), default 100
§Examples
// Wait for page title to change
page.wait_for_function(
    "() => document.title === 'Loaded'",
    Some(5000),
    None
).await?;

// Wait for global variable
page.wait_for_function(
    "() => window.myApp && window.myApp.ready",
    None,
    None
).await?;
Source

pub async fn wait_for_navigation( self: &Arc<Self>, options: Option<WaitForNavigationOptions>, ) -> Result<()>

Wait for page navigation to complete

Supports multiple wait conditions:

  • Load: Wait for load event (all resources loaded)
  • DOMContentLoaded: Wait for DOM tree construction to complete
  • NetworkIdle0: Wait for network to be fully idle (no requests for 500ms)
  • NetworkIdle2: Wait for network to be almost idle (<= 2 requests for 500ms)
§Parameters
  • options - Navigation wait options (timeout, wait condition, etc.)
§Examples
// Wait for load event (default)
page.wait_for_navigation(None).await?;

// Wait for DOMContentLoaded (faster)
page.wait_for_navigation(Some(WaitForNavigationOptions {
    timeout_ms: Some(5000),
    wait_until: Some(WaitUntil::DOMContentLoaded),
})).await?;

// Wait for network idle (suitable for SPA)
page.wait_for_navigation(Some(WaitForNavigationOptions {
    timeout_ms: Some(10000),
    wait_until: Some(WaitUntil::NetworkIdle2),
})).await?;
Source

pub async fn on_network(&self, callback: NetworkEventCallback)

Register network event callback

§Examples
page.enable_network_monitoring().await?;

page.on_network(Arc::new(|event| {
    match event {
        NetworkEvent::RequestWillBeSent { url, method, .. } => {
            println!("[{}] {}", method, url);
        }
        NetworkEvent::ResponseReceived { request_id, status, .. } => {
            println!("[{}] Status: {}", request_id, status);
        }
        NetworkEvent::LoadingFailed { request_id, error_text } => {
            eprintln!("[{}] Failed: {}", request_id, error_text);
        }
        _ => {}
    }
})).await;
Source

pub fn get_inflight_requests_count(&self) -> usize

Get count of currently active network requests

§Examples
page.enable_network_monitoring().await?;

let count = page.get_inflight_requests_count();
println!("Active requests: {}", count);
Source

pub async fn wait_for_timeout(&self, ms: u64)

Wait for specified time (ms)

§Examples
// Wait for 2 seconds
page.wait_for_timeout(2000).await;
Source

pub async fn cleanup(&self) -> Result<()>

Clean up Page resources (explicit async cleanup)

This method will:

  1. Clear all network monitors and interceptors
  2. Disable all enabled CDP Domains
  3. Clear Frame cache and callbacks
§Best Practices

Although Page automatically cleans up on Drop, it is recommended to call this method explicitly when Page is no longer used:

let browser = Browser::launcher().launch().await?;
let page = browser.new_page().await?;

// Use page...

// Explicitly cleanup when no longer used
page.cleanup().await?;
§Note
  • After calling this method, Page will be in an unusable state
  • If Page is shared via Arc, ensure no other places are still using it
  • Cleanup is also performed automatically on Drop, but explicit call gives better control over timing and error handling

Trait Implementations§

Source§

impl CookieManager for Page

Source§

fn get_cookies<'life0, 'async_trait>( &'life0 self, urls: Option<Vec<String>>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Cookie>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Gets cookies for the current page context.
Sets a cookie.
Source§

fn delete_cookies<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, url: Option<String>, domain: Option<String>, path: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Deletes cookies.
Source§

fn clear_browser_cookies<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Clears all browser cookies for the current browser context.
Source§

impl Drop for Page

RAII automatic cleanup implementation

Automatically cleans up all resources when Page is dropped

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl LocalStorageExt for Page

Source§

fn get_local_storage<'life0, 'async_trait>( self: &'life0 Arc<Self>, ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_local_storage_item<'life0, 'life1, 'async_trait>( self: &'life0 Arc<Self>, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn set_local_storage_item<'life0, 'life1, 'life2, 'async_trait>( self: &'life0 Arc<Self>, key: &'life1 str, value: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn remove_local_storage_item<'life0, 'life1, 'async_trait>( self: &'life0 Arc<Self>, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn clear_local_storage<'life0, 'async_trait>( self: &'life0 Arc<Self>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

impl NetworkInterceptor for Page

Source§

fn enable_request_interception<'life0, 'async_trait>( self: &'life0 Arc<Self>, patterns: Vec<String>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Enables request interception with the provided URL patterns.
Source§

fn disable_request_interception<'life0, 'async_trait>( self: &'life0 Arc<Self>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Disables request interception.
Source§

fn continue_request<'life0, 'life1, 'async_trait>( self: &'life0 Arc<Self>, request_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Continues a request without modification.
Source§

fn continue_request_with_modification<'life0, 'life1, 'async_trait>( self: &'life0 Arc<Self>, request_id: &'life1 str, modification: RequestModification, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Continues a request after applying the provided modifications.
Source§

fn fail_request<'life0, 'life1, 'life2, 'async_trait>( self: &'life0 Arc<Self>, request_id: &'life1 str, error_reason: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Aborts the request with the CDP error reason provided.
Source§

fn fulfill_request<'life0, 'life1, 'async_trait>( self: &'life0 Arc<Self>, request_id: &'life1 str, response: ResponseMock, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fulfills the request with a mocked response payload.
Source§

fn continue_response<'life0, 'life1, 'async_trait>( self: &'life0 Arc<Self>, request_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Continues the response without modification.
Source§

fn continue_response_with_modification<'life0, 'life1, 'async_trait>( self: &'life0 Arc<Self>, request_id: &'life1 str, response: ResponseMock, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Continues the response after applying modifications.
Source§

impl PageSessionManager for Page

Source§

fn export_session<'life0, 'async_trait>( self: &'life0 Arc<Self>, ) -> Pin<Box<dyn Future<Output = Result<PageSession>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Export complete page session (cookies + storage)
Source§

fn import_session<'life0, 'life1, 'async_trait>( self: &'life0 Arc<Self>, session: &'life1 PageSession, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Import complete page session (cookies + storage) Note: This will navigate to the session URL first
Source§

fn export_session_to_file<'life0, 'life1, 'async_trait>( self: &'life0 Arc<Self>, path: &'life1 Path, ) -> Pin<Box<dyn Future<Output = Result<PageSession>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Export session and save to file
Source§

fn import_session_from_file<'life0, 'life1, 'async_trait>( self: &'life0 Arc<Self>, path: &'life1 Path, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Load session from file and import
Source§

impl PageSessionSnapshot for Page

Source§

fn snapshot<'life0, 'async_trait>( self: &'life0 Arc<Self>, ) -> Pin<Box<dyn Future<Output = Result<PageSession>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create a quick snapshot of current session
Source§

fn restore<'life0, 'life1, 'async_trait>( self: &'life0 Arc<Self>, snapshot: &'life1 PageSession, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Restore from a snapshot
Source§

fn clone_session_to<'life0, 'life1, 'async_trait>( self: &'life0 Arc<Self>, target: &'life1 Arc<Page>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Clone current session to another page
Source§

impl RequestInterceptorExt for Page

Source§

fn intercept_all_requests<'life0, 'async_trait>( self: &'life0 Arc<Self>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Intercepts every request.
Source§

fn intercept_requests_matching<'life0, 'life1, 'async_trait>( self: &'life0 Arc<Self>, pattern: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Intercepts requests that match the provided pattern.
Source§

fn block_images<'life0, 'async_trait>( self: &'life0 Arc<Self>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Blocks common image formats.
Source§

fn block_stylesheets<'life0, 'async_trait>( self: &'life0 Arc<Self>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Blocks stylesheet resources.
Source§

impl SessionStorageExt for Page

Source§

fn get_session_storage<'life0, 'async_trait>( self: &'life0 Arc<Self>, ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_session_storage_item<'life0, 'life1, 'async_trait>( self: &'life0 Arc<Self>, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn set_session_storage_item<'life0, 'life1, 'life2, 'async_trait>( self: &'life0 Arc<Self>, key: &'life1 str, value: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn remove_session_storage_item<'life0, 'life1, 'async_trait>( self: &'life0 Arc<Self>, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn clear_session_storage<'life0, 'async_trait>( self: &'life0 Arc<Self>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

impl StorageManager for Page

Source§

fn get_storage_items<'life0, 'async_trait>( self: &'life0 Arc<Self>, storage_type: StorageType, ) -> Pin<Box<dyn Future<Output = Result<Vec<StorageItem>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Gets all items from the specified storage type
Source§

fn get_storage_item<'life0, 'life1, 'async_trait>( self: &'life0 Arc<Self>, storage_type: StorageType, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Gets a specific item from storage by key
Source§

fn set_storage_item<'life0, 'life1, 'life2, 'async_trait>( self: &'life0 Arc<Self>, storage_type: StorageType, key: &'life1 str, value: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Sets an item in storage
Source§

fn remove_storage_item<'life0, 'life1, 'async_trait>( self: &'life0 Arc<Self>, storage_type: StorageType, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Removes an item from storage by key
Source§

fn clear_storage<'life0, 'async_trait>( self: &'life0 Arc<Self>, storage_type: StorageType, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Clears all items from the specified storage type
Source§

fn get_storage_length<'life0, 'async_trait>( self: &'life0 Arc<Self>, storage_type: StorageType, ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Gets the number of items in storage

Auto Trait Implementations§

§

impl Freeze for Page

§

impl !RefUnwindSafe for Page

§

impl Send for Page

§

impl Sync for Page

§

impl Unpin for Page

§

impl !UnwindSafe for Page

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more