Skip to main content

Client

Struct Client 

Source
pub struct Client { /* private fields */ }
Expand description

A connected inspector client.

MessageStream is the object-safe half of the endpoint-libs transport seam, so the concrete framing type, which is opaque, never has to be named.

Implementations§

Source§

impl Client

Source

pub fn select_target(&mut self, target: Option<TargetSelector>)

Source

pub fn target_context(&self) -> Option<&TargetContext>

Source

pub async fn connect(socket: &Path) -> Result<Self>

Source

pub fn set_request_timeout(&mut self, request_timeout: Duration)

Bound every inspector exchange for a latency-sensitive command.

Interactive dump/diagnostic modes retain the generous default. QA and coverage explicitly lower it so a dead action cannot multiply a minute-long transport wait across a suite.

Source

pub fn request_timeout(&self) -> Duration

Source

pub fn is_terminal(&self) -> bool

Source

pub fn terminal_is_timeout(&self) -> bool

Source

pub fn terminal_failure_message(&self) -> Option<String>

Source

pub async fn raw_request( &mut self, method: &str, params: Value, ) -> Result<Value>

A raw JSON-RPC call, for initialize and tools/list, which are not tool calls and so have no typed request in the protocol crate.

Source

pub async fn initialize(&mut self) -> Result<Value>

Source

pub async fn tools_list(&mut self) -> Result<Value>

Source

pub async fn agent(&mut self, request: &AgentControlRequest) -> Result<Answer>

An agent-control call, encoded from the server’s own type.

This is the whole reason the protocol crate exists. AgentAction is adjacently tagged, so the {"action":"click","nodeId":9} that reads correctly is not what the server accepts, and getting it wrong used to present as a hung application rather than as an encoding mistake.

Source

pub async fn diagnostics( &mut self, request: &DiagnosticsRequest, ) -> Result<Answer>

Source

pub async fn arm_paint_events(&mut self) -> Result<bool>

Establish a paint-event baseline immediately before driving input.

New runtimes answer with Ack and suppress any revision that predates this call. Older runtimes answer streamingUnavailable; callers retain their bounded compatibility fallback in that case.

Source

pub async fn wait_for_paint(&mut self, within: Duration) -> Result<bool>

Wait for the first real frame committed after an armed interaction.

Source

pub async fn diagnostics_envelope( &mut self, request: &DiagnosticsRequest, ) -> Result<Value>

The same call, but returning a protocol-level error rather than failing on it.

watch needs this because observe is not implemented server-side: it answers streamingUnavailable. Printing that answer and then draining is what the previous client did, and it is the more useful behaviour: the mode reports what the server said instead of dying on it.

Source

pub async fn agent_envelope( &mut self, request: &AgentControlRequest, ) -> Result<Value>

Source

pub async fn drain(&mut self, seconds: f64) -> Result<Vec<Value>>

Collect pushed notifications for a while, as watch does.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Client

§

impl !Sync for Client

§

impl !UnwindSafe for Client

§

impl Forget for Client

§

impl Freeze for Client

§

impl Move for Client

§

impl Send for Client

§

impl Unpin for Client

§

impl UnsafeUnpin for Client

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> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> MaybeBoxed<Box<T>> for T

Source§

fn maybe_boxed(self) -> Box<T>

Convert
Source§

impl<T> MaybeBoxed<T> for T

Source§

fn maybe_boxed(self) -> T

Convert
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

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<T> WasmNotSend for T
where T: Send,

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