pub trait DeviceDriver: Send + Sync {
Show 15 methods
// Required methods
fn connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn ensure_connected<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn tap<'life0, 'async_trait>(
&'life0 self,
x: i32,
y: i32,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn swipe<'life0, 'async_trait>(
&'life0 self,
x1: i32,
y1: i32,
x2: i32,
y2: i32,
duration_ms: u32,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn input_text<'life0, 'life1, 'async_trait>(
&'life0 self,
text: &'life1 str,
clear: bool,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn press_key<'life0, 'async_trait>(
&'life0 self,
keycode: i32,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn drag<'life0, 'async_trait>(
&'life0 self,
x1: i32,
y1: i32,
x2: i32,
y2: i32,
duration_ms: u32,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn start_app<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
package: &'life1 str,
activity: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn install_app<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_apps<'life0, 'async_trait>(
&'life0 self,
include_system: bool,
) -> Pin<Box<dyn Future<Output = Result<Vec<AppInfo>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn list_packages<'life0, 'async_trait>(
&'life0 self,
include_system: bool,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn screenshot<'life0, 'async_trait>(
&'life0 self,
hide_overlay: bool,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_ui_tree<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_date<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn supported_actions(&self) -> &HashSet<Action>;
}Expand description
Trait for all device drivers.
Concrete drivers implement the methods they support.
Unsupported methods return DroidrunError::NotSupported.
Required Methods§
Sourcefn connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Establish connection to the device.
Sourcefn ensure_connected<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn ensure_connected<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Connect if not already connected.
Sourcefn tap<'life0, 'async_trait>(
&'life0 self,
x: i32,
y: i32,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn tap<'life0, 'async_trait>(
&'life0 self,
x: i32,
y: i32,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Tap at absolute pixel coordinates.
Sourcefn swipe<'life0, 'async_trait>(
&'life0 self,
x1: i32,
y1: i32,
x2: i32,
y2: i32,
duration_ms: u32,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn swipe<'life0, 'async_trait>(
&'life0 self,
x1: i32,
y1: i32,
x2: i32,
y2: i32,
duration_ms: u32,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Swipe from (x1, y1) to (x2, y2) over duration_ms.
Sourcefn input_text<'life0, 'life1, 'async_trait>(
&'life0 self,
text: &'life1 str,
clear: bool,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn input_text<'life0, 'life1, 'async_trait>(
&'life0 self,
text: &'life1 str,
clear: bool,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Type text into the currently focused field.
Sourcefn press_key<'life0, 'async_trait>(
&'life0 self,
keycode: i32,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn press_key<'life0, 'async_trait>(
&'life0 self,
keycode: i32,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send a single key event.
Sourcefn drag<'life0, 'async_trait>(
&'life0 self,
x1: i32,
y1: i32,
x2: i32,
y2: i32,
duration_ms: u32,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn drag<'life0, 'async_trait>(
&'life0 self,
x1: i32,
y1: i32,
x2: i32,
y2: i32,
duration_ms: u32,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Drag from (x1, y1) to (x2, y2).
Sourcefn start_app<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
package: &'life1 str,
activity: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn start_app<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
package: &'life1 str,
activity: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Launch an application.
Sourcefn install_app<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn install_app<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Install an APK.
Sourcefn get_apps<'life0, 'async_trait>(
&'life0 self,
include_system: bool,
) -> Pin<Box<dyn Future<Output = Result<Vec<AppInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_apps<'life0, 'async_trait>(
&'life0 self,
include_system: bool,
) -> Pin<Box<dyn Future<Output = Result<Vec<AppInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List installed apps with labels.
Sourcefn list_packages<'life0, 'async_trait>(
&'life0 self,
include_system: bool,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_packages<'life0, 'async_trait>(
&'life0 self,
include_system: bool,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List installed package names.
Sourcefn screenshot<'life0, 'async_trait>(
&'life0 self,
hide_overlay: bool,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn screenshot<'life0, 'async_trait>(
&'life0 self,
hide_overlay: bool,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Take a screenshot (PNG bytes).
Sourcefn get_ui_tree<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_ui_tree<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the accessibility tree + phone state as JSON.
Sourcefn get_date<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_date<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the device date/time.
Sourcefn supported_actions(&self) -> &HashSet<Action>
fn supported_actions(&self) -> &HashSet<Action>
Which actions this driver supports.