pub struct Controller { /* private fields */ }Expand description
A connected emulator controller.
Status, screenshots and frames use one HTTP/2 connection and touches a
second one, which halved drag-input p95 while native frames streamed (S7).
The client sends no keys: without a keyboard device the emulator accepts
and drops them, so Controller::keys_supported tells the driver whether
keys may go this way at all.
Implementations§
Source§impl Controller
impl Controller
Sourcepub async fn connect(
endpoint: &Endpoint,
options: Options,
) -> Result<Self, Unavailable>
pub async fn connect( endpoint: &Endpoint, options: Options, ) -> Result<Self, Unavailable>
Opens both connections and reads the hardware through getStatus. Any
failure, including a port that accepts connections and never answers,
makes the endpoint Unavailable.
pub fn serial(&self) -> &str
Sourcepub fn keys_supported(&self) -> bool
pub fn keys_supported(&self) -> bool
Whether keys and text may be sent through the controller: only when the
AVD declares a keyboard (hw.keyboard=yes).
Sourcepub async fn touch(&self, points: &[TouchPoint]) -> Result<Duration, Error>
pub async fn touch(&self, points: &[TouchPoint]) -> Result<Duration, Error>
Sends one touch event holding points on the main display and returns
the round trip. The emulator acknowledges once it has scheduled the
event, not when the app received it.
Sourcepub async fn tap(&self, x: i32, y: i32) -> Result<(), Error>
pub async fn tap(&self, x: i32, y: i32) -> Result<(), Error>
Presses and lifts contact 0 at (x, y), in display pixels.
Sourcepub async fn screenshot(&self) -> Result<Frame, Error>
pub async fn screenshot(&self) -> Result<Frame, Error>
A raw RGB888 capture at the display’s full resolution.
Trait Implementations§
Source§impl Clone for Controller
impl Clone for Controller
Auto Trait Implementations§
impl !Freeze for Controller
impl !RefUnwindSafe for Controller
impl !UnwindSafe for Controller
impl Send for Controller
impl Sync for Controller
impl Unpin for Controller
impl UnsafeUnpin for Controller
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request