pub struct Session { /* private fields */ }Expand description
An attached agent serving a mirror. Clones share it.
Implementations§
Source§impl Session
impl Session
Sourcepub fn start(
attached: Attached,
options: SessionOptions,
controller: Option<ControllerLink>,
) -> Result<Session, SessionError>
pub fn start( attached: Attached, options: SessionOptions, controller: Option<ControllerLink>, ) -> Result<Session, SessionError>
A session over attached: reads the display density for the scale,
and uses controller, when given, for touches and frames.
Sourcepub fn start_selected(
attached: Attached,
options: SessionOptions,
selection: Selection,
) -> Result<Session, SessionError>
pub fn start_selected( attached: Attached, options: SessionOptions, selection: Selection, ) -> Result<Session, SessionError>
A session over attached on the paths selection chose (see
select_paths).
Sourcepub fn status(&self) -> Status
pub fn status(&self) -> Status
What the session reports: the agent, the active paths, the keyboard capability, the fallback warning and what failed since.
Sourcepub fn backend(&self) -> Backend
pub fn backend(&self) -> Backend
The backend a mirror::Mirror runs on. Taken once: the event stream
has one reader.
§Panics
When called a second time.
pub fn agent(&self) -> &AgentInfo
Sourcepub fn uses_controller(&self) -> bool
pub fn uses_controller(&self) -> bool
Whether touches and frames go through the emulator’s controller.
Sourcepub fn frames_received(&self) -> u64
pub fn frames_received(&self) -> u64
Frames received from the controller so far.
Sourcepub fn inputs(&self) -> (u64, u64)
pub fn inputs(&self) -> (u64, u64)
Inputs sent so far: through the controller, and through the agent.
Sourcepub fn controller_error(&self) -> Option<String>
pub fn controller_error(&self) -> Option<String>
Why the controller stopped taking input, once it failed; input then goes through the agent.
Sourcepub fn frame_error(&self) -> Option<String>
pub fn frame_error(&self) -> Option<String>
The last failure of the controller’s frame stream, which the session subscribes to again.
Sourcepub fn screenshot(&self, params: ScreenshotParams) -> Result<Screenshot, Error>
pub fn screenshot(&self, params: ScreenshotParams) -> Result<Screenshot, Error>
A screenshot through the agent.
Sourcepub fn close_reason(&self) -> Option<DisconnectReason>
pub fn close_reason(&self) -> Option<DisconnectReason>
Why the connection to the agent closed, once it has.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Session
impl !UnwindSafe for Session
impl Freeze for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
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