pub struct Control {
pub pid: u32,
pub service: String,
pub log_path: PathBuf,
/* private fields */
}Fields§
§pid: u32§service: Stringrightkit-service name the app serves (control-xxxxxxxx).
log_path: PathBufImplementations§
Source§impl Control
impl Control
pub fn set_request_timeout(&mut self, t: Duration)
pub fn health(&self) -> Result<Value>
Sourcepub fn unlisted_app_probe(&self) -> Result<String>
pub fn unlisted_app_probe(&self) -> Result<String>
Prove the allowlist: an app that is not on it is refused at hello. Returns the error code.
pub fn click(&self, x: f64, y: f64, button: &str, count: u32) -> Result<()>
Sourcepub fn click_with(
&self,
x: f64,
y: f64,
button: &str,
count: u32,
modifiers: &[&str],
) -> Result<()>
pub fn click_with( &self, x: f64, y: f64, button: &str, count: u32, modifiers: &[&str], ) -> Result<()>
click holding modifiers ("shift", "cmd", "alt", "ctrl"). They
travel on the native mouse events, so the page sees e.shiftKey etc. as real input.
pub fn move_to(&self, x: f64, y: f64) -> Result<()>
pub fn drag(&self, from: (f64, f64), to: (f64, f64), steps: u32) -> Result<()>
pub fn wheel(&self, x: f64, y: f64, dx: f64, dy: f64) -> Result<()>
pub fn key(&self, spec: &str) -> Result<()>
pub fn type_text(&self, text: &str) -> Result<()>
Sourcepub fn eval(&self, js: &str) -> Result<Value>
pub fn eval(&self, js: &str) -> Result<Value>
Evaluate a JS function body (return ...) in the page; returns its JSON value.
pub fn dom(&self, selector: &str) -> Result<Vec<Value>>
pub fn ax(&self) -> Result<Vec<Value>>
pub fn screenshot_png(&self) -> Result<Vec<u8>>
pub fn screenshot_to(&self, path: &Path) -> Result<()>
Sourcepub fn command(&self, name: &str, args: &Value) -> Result<Value>
pub fn command(&self, name: &str, args: &Value) -> Result<Value>
A typed app command registered with Control::command(name, f). The server
hands the command its args string verbatim.
Sourcepub fn center_of(&self, selector: &str) -> Result<(f64, f64)>
pub fn center_of(&self, selector: &str) -> Result<(f64, f64)>
Centre of the first element matching selector, in viewport CSS px.
pub fn click_selector(&self, selector: &str) -> Result<()>
Sourcepub fn wait_eval(&self, js: &str, timeout: Duration) -> Result<Value>
pub fn wait_eval(&self, js: &str, timeout: Duration) -> Result<Value>
Poll a JS function body until it returns something truthy; bounded.
Sourcepub fn stop(&mut self) -> Result<StopReport>
pub fn stop(&mut self) -> Result<StopReport>
Stop the app: kill the recorded pid tree, prove the port closed, and check we did not change the frontmost app.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Control
impl !RefUnwindSafe for Control
impl !UnwindSafe for Control
impl Send for Control
impl Sync for Control
impl Unpin for Control
impl UnsafeUnpin for Control
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more