Skip to main content

WebInspectorClient

Struct WebInspectorClient 

Source
pub struct WebInspectorClient<S> { /* private fields */ }

Implementations§

Source§

impl<S: AsyncRead + AsyncWrite + Unpin> WebInspectorClient<S>

Source

pub fn new(stream: S) -> Self

Source

pub fn with_connection_id(stream: S, connection_id: impl Into<String>) -> Self

Source

pub fn connection_id(&self) -> &str

Source

pub fn automation_availability(&self) -> Option<AutomationAvailability>

Source

pub fn applications(&self) -> &IndexMap<String, Application>

Source

pub fn application_pages( &self, application_id: &str, ) -> Option<&IndexMap<u64, Page>>

Source

pub fn application_by_bundle( &self, bundle_identifier: &str, ) -> Option<&Application>

Source

pub fn page(&self, application_id: &str, page_id: u64) -> Option<&Page>

Source

pub fn automation_page_by_session( &self, application_id: &str, session_id: &str, ) -> Option<&Page>

Source

pub fn open_pages_snapshot(&self) -> Vec<ApplicationPage>

Source

pub async fn start( &mut self, timeout_duration: Duration, ) -> Result<(), WebInspectorError>

Source

pub async fn open_application_pages( &mut self, idle_timeout: Duration, ) -> Result<Vec<ApplicationPage>, WebInspectorError>

Discovers all open application pages on the device.

Sends _rpc_getConnectedApplications: and consumes incoming events until no new event arrives within idle_timeout. The timeout signals quiescence (no more pages are being reported) and is the expected completion path — it is not an error. Returns the accumulated snapshot of open pages.

Source

pub async fn report_identifier(&mut self) -> Result<(), WebInspectorError>

Source

pub async fn request_connected_applications( &mut self, ) -> Result<(), WebInspectorError>

Source

pub async fn request_listing( &mut self, application_id: &str, ) -> Result<(), WebInspectorError>

Source

pub async fn request_application_launch( &mut self, bundle_identifier: &str, ) -> Result<(), WebInspectorError>

Source

pub async fn request_automation_session( &mut self, session_id: &str, application_id: &str, ) -> Result<(), WebInspectorError>

Source

pub async fn send_socket_setup( &mut self, session_id: &str, application_id: &str, page_id: u64, pause: bool, ) -> Result<(), WebInspectorError>

Source

pub async fn send_socket_data( &mut self, session_id: &str, application_id: &str, page_id: u64, message: &JsonValue, ) -> Result<(), WebInspectorError>

Source

pub async fn next_event( &mut self, ) -> Result<WebInspectorEvent, WebInspectorError>

Source

pub async fn next_event_with_timeout( &mut self, timeout_duration: Duration, ) -> Result<WebInspectorEvent, WebInspectorError>

Trait Implementations§

Source§

impl<S: Debug> Debug for WebInspectorClient<S>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<S> Freeze for WebInspectorClient<S>
where S: Freeze,

§

impl<S> RefUnwindSafe for WebInspectorClient<S>
where S: RefUnwindSafe,

§

impl<S> Send for WebInspectorClient<S>
where S: Send,

§

impl<S> Sync for WebInspectorClient<S>
where S: Sync,

§

impl<S> Unpin for WebInspectorClient<S>
where S: Unpin,

§

impl<S> UnsafeUnpin for WebInspectorClient<S>
where S: UnsafeUnpin,

§

impl<S> UnwindSafe for WebInspectorClient<S>
where S: UnwindSafe,

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<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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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