Skip to main content

TabsExt

Trait TabsExt 

Source
pub trait TabsExt {
    // Required methods
    fn tab_list(
        &self,
    ) -> impl Future<Output = Result<Vec<TabInfo>, BrowserError>> + Send;
    fn tab_new(
        &self,
        url: Option<&str>,
    ) -> impl Future<Output = Result<(), BrowserError>> + Send;
    fn tab_close(
        &self,
        index: Option<usize>,
    ) -> impl Future<Output = Result<(), BrowserError>> + Send;
    fn tab_select(
        &self,
        index: usize,
    ) -> impl Future<Output = Result<(), BrowserError>> + Send;
    fn dialog_accept(
        &self,
        text: Option<&str>,
    ) -> impl Future<Output = Result<(), BrowserError>> + Send;
    fn dialog_dismiss(
        &self,
    ) -> impl Future<Output = Result<(), BrowserError>> + Send;
}
Expand description

Tab operations for browser client

Required Methods§

Source

fn tab_list( &self, ) -> impl Future<Output = Result<Vec<TabInfo>, BrowserError>> + Send

List all browser tabs

Source

fn tab_new( &self, url: Option<&str>, ) -> impl Future<Output = Result<(), BrowserError>> + Send

Open a new tab, optionally with URL

Source

fn tab_close( &self, index: Option<usize>, ) -> impl Future<Output = Result<(), BrowserError>> + Send

Close a tab by index (or current if None)

Source

fn tab_select( &self, index: usize, ) -> impl Future<Output = Result<(), BrowserError>> + Send

Select/switch to a tab by index

Source

fn dialog_accept( &self, text: Option<&str>, ) -> impl Future<Output = Result<(), BrowserError>> + Send

Accept a dialog (alert, confirm, prompt) with optional text

Source

fn dialog_dismiss( &self, ) -> impl Future<Output = Result<(), BrowserError>> + Send

Dismiss a dialog (alert, confirm, prompt)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§