Skip to main content

Session

Struct Session 

Source
pub struct Session {
    pub udid: String,
    pub config: Config,
    pub tunnel: Option<Tunnel>,
    pub ax: Option<AxSub>,
    pub input: Option<InputSession>,
    pub connects: u64,
    pub ax_restarts: u64,
    pub dnd: State,
    /* private fields */
}

Fields§

§udid: String§config: Config§tunnel: Option<Tunnel>§ax: Option<AxSub>§input: Option<InputSession>§connects: u64

Counts tunnel (re)connections, for iph doctor and logs.

§ax_restarts: u64

How often, and when last, the phone’s accessibility daemon was ended because it had stopped answering.

§dnd: State

Do Not Disturb: whether it is on for this session and what to put back.

Implementations§

Source§

impl Session

Source

pub async fn cmd_read(&mut self, args: ReadArgs) -> Res

Source

pub async fn cmd_find(&mut self, args: FindArgs) -> Res

Source

pub async fn cmd_tap(&mut self, args: TapArgs) -> Res

Source

pub async fn cmd_swipe(&mut self, args: SwipeArgs) -> Res

Source

pub async fn cmd_pinch(&mut self, args: PinchArgs) -> Res

Two fingers pinching, spreading or turning around a point. Arguments that cannot make a gesture, or a point with no room for one, fail before anything is sent. screen_changed: false is a fair answer on a screen that does not zoom.

Source

pub async fn cmd_scroll(&mut self, args: ScrollArgs) -> Res

Source

pub async fn cmd_key(&mut self, args: KeyArgs) -> Res

Source

pub async fn cmd_button(&mut self, args: ButtonArgs) -> Res

Source

pub async fn cmd_apps(&mut self) -> Res

Source

pub async fn cmd_launch(&mut self, args: LaunchArgs) -> Res

Source

pub async fn cmd_screenshot(&mut self, args: ScreenshotArgs) -> Res

Source

pub async fn cmd_type(&mut self, args: TypeArgs) -> Res

Source§

impl Session

Source

pub fn new(udid: String, config: Config) -> Self

Source

pub fn invalidate_readings(&mut self)

Source

pub async fn service_port(&mut self, name: &str) -> Res<(AdapterHandle, u16)>

Port of an RSD service, for connections made outside &mut self.

Source

pub fn drop_input(&mut self)

Abandon the input session without the orderly close (after an error).

Source

pub fn reset(&mut self)

Drop every connection. The next request builds them again.

Source

pub async fn sweep(&mut self)

Tell the phone to stop the streams of abandoned input sessions. Left alone they keep the phone encoding, and after a row of timeouts (2026-11-11, with the Mac overloaded) the phone answered ever slower.

Source

pub fn connection(&self) -> Option<&str>

Source

pub async fn ensure_tunnel(&mut self) -> Res<&mut Tunnel>

Source

pub async fn dump(&mut self, fresh: Fresh, full: bool) -> Res<(u64, Arc<Dump>)>

One reading of the screen as the raw dump plus its sequence number. full waits for the second pass (identifiers).

Source

pub async fn screen( &mut self, fresh: Fresh, full: bool, opts: BuildOptions, ) -> Res<(u64, Screen)>

Source

pub async fn ensure_input(&mut self) -> Res<&mut InputSession>

Open the input session if needed. Fails with not_sent: nothing has been written to the phone when this returns an error.

Source

pub async fn send_gesture(&mut self, gesture: Gesture) -> Res<()>

Send one gesture. The phone sometimes closes the input connections on its own (it answers the next report with a reset, seen 2026-11-11); iph only finds out when it writes. When that write fails before a single report went out, nothing reached the phone, so a new session is opened and the gesture is sent once more. A gesture that failed halfway is never repeated.

Source

pub async fn close_idle_input(&mut self)

Close the input session when it has not been used for a while; the media stream keeps the phone encoding video.

Source

pub async fn close_input(&mut self)

End the input session now.

Source

pub async fn close_input_if_unheld(&mut self)

With input_idle_secs = 0 the input session ends with each command, so the phone shows “screen sharing” only while input is being sent. For apps that hide their content or complain while the screen is shared. Every input then pays for a new session (3 to 4 s).

Source

pub async fn shutdown(&mut self)

Source

pub async fn app_service(&mut self) -> Res<AppServiceClient<Box<dyn ReadWrite>>>

Source

pub async fn pasteboard( &mut self, ) -> Res<PasteboardServiceClient<Box<dyn ReadWrite>>>

Source

pub async fn list_apps(&mut self, refresh: bool) -> Res<Vec<AppListEntry>>

Source

pub async fn screenshot_png(&mut self) -> Res<Vec<u8>>

Source§

impl Session

Source

pub async fn cmd_dnd(&mut self, args: DndArgs) -> Res

Source§

impl Session

Source

pub async fn cmd_script(&mut self, code: &str, args: &Map<String, Value>) -> Res

Source

pub async fn serve_script(&mut self, req: &Value) -> Res

Serve a script request (see request).

Source§

impl Session

Source

pub async fn run_steps( &mut self, steps: &[Value], args: &Map<String, Value>, ) -> Res

Run steps in order and stop at the first failure.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ParallelSend for T

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more