Skip to main content

StorageExt

Trait StorageExt 

Source
pub trait StorageExt {
    // Required methods
    fn cookies(
        &self,
    ) -> impl Future<Output = Result<Vec<Cookie>, BrowserError>> + Send;
    fn cookies_set(
        &self,
        name: &str,
        value: &str,
    ) -> impl Future<Output = Result<(), BrowserError>> + Send;
    fn storage_get(
        &self,
        storage_type: &str,
        key: Option<&str>,
    ) -> impl Future<Output = Result<JsonValue, BrowserError>> + Send;
    fn storage_set(
        &self,
        storage_type: &str,
        key: &str,
        value: &str,
    ) -> impl Future<Output = Result<(), BrowserError>> + Send;
    fn network_requests(
        &self,
        filter: Option<&str>,
    ) -> impl Future<Output = Result<Vec<Request>, BrowserError>> + Send;
    fn set_viewport(
        &self,
        width: u32,
        height: u32,
        scale: Option<f32>,
    ) -> impl Future<Output = Result<(), BrowserError>> + Send;
    fn set_device(
        &self,
        name: &str,
    ) -> impl Future<Output = Result<(), BrowserError>> + Send;
    fn set_geo(
        &self,
        latitude: f64,
        longitude: f64,
    ) -> impl Future<Output = Result<(), BrowserError>> + Send;
}
Expand description

Storage, cookies, network, and device operations for browser client

Required Methods§

Source

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

Get all cookies

Source

fn cookies_set( &self, name: &str, value: &str, ) -> impl Future<Output = Result<(), BrowserError>> + Send

Set a cookie

Source

fn storage_get( &self, storage_type: &str, key: Option<&str>, ) -> impl Future<Output = Result<JsonValue, BrowserError>> + Send

Get storage value (local or session)

Source

fn storage_set( &self, storage_type: &str, key: &str, value: &str, ) -> impl Future<Output = Result<(), BrowserError>> + Send

Set storage value (local or session)

Source

fn network_requests( &self, filter: Option<&str>, ) -> impl Future<Output = Result<Vec<Request>, BrowserError>> + Send

Get network requests

Source

fn set_viewport( &self, width: u32, height: u32, scale: Option<f32>, ) -> impl Future<Output = Result<(), BrowserError>> + Send

Set viewport size

Source

fn set_device( &self, name: &str, ) -> impl Future<Output = Result<(), BrowserError>> + Send

Set device emulation

Source

fn set_geo( &self, latitude: f64, longitude: f64, ) -> impl Future<Output = Result<(), BrowserError>> + Send

Set geolocation

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§