Skip to main content

Crate smix_driver

Crate smix_driver 

Source
Expand description

smix-driver — the decide layer.

Wraps HttpRunnerClient (sense + act IPC) with host-side resolve dispatch. The default path is: SDK call → driver.tap → tree() → resolve_selector() → centroid → runner.tap_at_norm_coord() (Apple native event chain).

§Failure model

All methods return Result<T, ExpectationFailure> — AI-readable rendering lives in smix-error.

§Implicit wait

tap includes a 5s poll-and-retry loop: if the first resolve_selector returns None, sleep 250 ms then re-fetch tree + re-resolve, up to a 5s total budget. Once a candidate is found we tap the same frame to avoid a split-fetch race.

Modules§

phases
Where a step’s time goes, by named phase.
poll
When a wait that polls has run out.
port_owner
Which device a runner port actually reaches. Lives with the client because that is the layer that opens the connection. Which device does this port actually reach?
settle
Waiting for a tap’s target to stop moving.
still
Is the screen still? Two frames compared on a grid.

Structs§

ActOutcome
What an act did, as opposed to what it attempted.
AndroidDriver
Android Driver impl. Wraps HttpRunnerClient connecting to the Kotlin runner via adb-forwarded port (default 28080, configurable via AndroidDriver::new(port)).
CaptureSpan
When a captured frame’s pixels were sampled, as an interval.
CoordinateSpace
The two coordinate spaces a tap passes through, and the orientation the synthesised event is stamped with.
HitElement
One element, as either side describes it.
HttpRunnerClient
IosDriver
Driver wrapping HttpRunnerClient with host-side resolve dispatch.
OcrFrame
Normalized OCR bounding box returned by HttpRunnerClient::find_text_by_ocr. Coordinates are normalized to [0, 1] in UIKit coord space (top-left origin, y-down). Apple Vision’s native bbox is bottom-left origin + y-up — the swift handler converts before returning so all consumers see UIKit coords.
PressTiming
What the runner reported about when a press was actually held, paired with what the host observed about the round trip.
Reach
What a scroll-until-visible asks of its target; part of ScrollUntil. What a scroll-until-visible asks of its target.
Rect
A rectangle as the runner reports it.
ScreenRegion
Part of the screen, in whole percent of its width and height.
ScrollUntil
What a scroll-until-visible asks for, and how long it may take.
SystemPopup
One system-popup discovered on the screen (alert / sheet / banner).

Enums§

ActVerdict
What an act turned out to have done.
ChainCoverage
What a chain of hit elements leaves out.
FramePlacement
Where a captured frame sits relative to the press.
IncludeScope
include scope literal — currently only all-windows (system popups pierce the app frame).
Orientation
Sim device orientation. Driver-level type; SDK exposes a 1:1 MaestroOrientation mirror for maestro yaml literal alignment.
OwnerProbe
Which host-side authority can say who holds a port.
Platform
Platform identifier for cross-platform dispatch.
RunnerTransportError
Transport-level failure (network, non-2xx, malformed body). Mirrors TS RunnerTransportError 1:1. #[non_exhaustive] because this list grows whenever a route learns to say something more precise than “no”, and every such addition would otherwise cost a major on its own. Unlike a new verb — which an external executor must handle or silently skip — a transport error a caller has not heard of degrades into its _ arm, which is the same place it would have landed before. The charge is paid once here.
ScreenAtTouch
What the screen was doing when a point was touched.
TapMode
POST /tap mode discriminator.
TapSpaceVerdict
Whether a tap may proceed, given the spaces it is about to cross.

Constants§

DEFAULT_SCROLL_TIMEOUT
maestro’s DEFAULT_TIMEOUT_IN_MILLIS for scrollUntilVisible.
OCR_RECOGNITION_LEVEL
The recognition level every OCR caller asks for.

Traits§

Driver
Sense + act capabilities for a single device. Two-trait architecture pair with smix_sdk::DeviceControl (sim/host control in smix-sdk).

Functions§

crown_turn_check
Why rotations turns at velocity turns a second is not a turn, or Ok when it is: a non-zero, finite number of turns, and a speed that is positive when one is given.
decide_tap_outcome
Decide before touching anything.
front_app_of
The bundle id this description was taken from, read off the a11y tree’s root identifier.
host_now_ms
Wall clock in milliseconds, for anchoring a press window and the captures taken alongside it to the same timeline.
landing_outcome
The verdict on a selector act, from what the runner said it touched.
latin_script_only
Scripts the Android recogniser can read.
locate
target as shares of the screen: a point is itself, an ocrText the middle of the text it reads, anything else the centre of the element it resolves to.
ocr_locales
The locales to read with, when the caller named none.
press_frame_placement
Was this frame captured while the touch was down?
scroll_until
Swipe direction until selector’s target is reached, per until.
tap_landed_within
Did the touch land inside the element it aimed at?
transport_to_failure
What a transport error means to a caller, in one place.
verdict_reader
The tree a landing is judged from, given the tree the aim was read from: the same one, always, and decided here and nowhere else.

Type Aliases§

Aimed
Where a touch aimed at a selector goes: the normalised point, the element it is aimed at, and the tree that aim was read from.
SimctlDriver
Back-compat alias. SimctlDriver was renamed to IosDriver for cross-platform naming; this alias keeps existing imports use smix_driver::SimctlDriver compiling.