Skip to main content

ChromeController

Trait ChromeController 

Source
pub trait ChromeController:
    Send
    + Sync
    + 'static {
    // Required methods
    fn status(&self) -> ChromeStatus;
    fn set_enabled(&self, enabled: bool);
    fn set_mode(&self, mode: ChromePermissionMode);
    fn dispatch<'life0, 'async_trait>(
        &'life0 self,
        command: ChromeCommand,
    ) -> Pin<Box<dyn Future<Output = Result<Value, ChromeError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn is_enabled(&self) -> bool { ... }
}
Expand description

Abstraction over the live browser bridge so model tools can be tested against a fake. Implemented by ChromeBridge.

Required Methods§

Source

fn status(&self) -> ChromeStatus

Current connection status.

Source

fn set_enabled(&self, enabled: bool)

Enable/disable Chrome tools for the session.

Source

fn set_mode(&self, mode: ChromePermissionMode)

Set the permission mode.

Source

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

Forward a command to the connected extension and await its result.

Provided Methods§

Source

fn is_enabled(&self) -> bool

Whether Chrome tools are enabled for the session.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§