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§
Get all cookies
Set a cookie
Sourcefn storage_get(
&self,
storage_type: &str,
key: Option<&str>,
) -> impl Future<Output = Result<JsonValue, BrowserError>> + Send
fn storage_get( &self, storage_type: &str, key: Option<&str>, ) -> impl Future<Output = Result<JsonValue, BrowserError>> + Send
Get storage value (local or session)
Sourcefn storage_set(
&self,
storage_type: &str,
key: &str,
value: &str,
) -> impl Future<Output = Result<(), BrowserError>> + Send
fn storage_set( &self, storage_type: &str, key: &str, value: &str, ) -> impl Future<Output = Result<(), BrowserError>> + Send
Set storage value (local or session)
Sourcefn network_requests(
&self,
filter: Option<&str>,
) -> impl Future<Output = Result<Vec<Request>, BrowserError>> + Send
fn network_requests( &self, filter: Option<&str>, ) -> impl Future<Output = Result<Vec<Request>, BrowserError>> + Send
Get network requests
Sourcefn set_viewport(
&self,
width: u32,
height: u32,
scale: Option<f32>,
) -> impl Future<Output = Result<(), BrowserError>> + Send
fn set_viewport( &self, width: u32, height: u32, scale: Option<f32>, ) -> impl Future<Output = Result<(), BrowserError>> + Send
Set viewport size
Sourcefn set_device(
&self,
name: &str,
) -> impl Future<Output = Result<(), BrowserError>> + Send
fn set_device( &self, name: &str, ) -> impl Future<Output = Result<(), BrowserError>> + Send
Set device emulation
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.