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
impl Client
pub fn select_target(&mut self, target: Option<TargetSelector>)
pub fn target_context(&self) -> Option<&TargetContext>
pub async fn connect(socket: &Path) -> Result<Self>
Sourcepub fn set_request_timeout(&mut self, request_timeout: Duration)
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.
pub fn request_timeout(&self) -> Duration
pub fn is_terminal(&self) -> bool
pub fn terminal_is_timeout(&self) -> bool
pub fn terminal_failure_message(&self) -> Option<String>
Sourcepub async fn raw_request(
&mut self,
method: &str,
params: Value,
) -> Result<Value>
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.
pub async fn initialize(&mut self) -> Result<Value>
pub async fn tools_list(&mut self) -> Result<Value>
Sourcepub async fn agent(&mut self, request: &AgentControlRequest) -> Result<Answer>
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.
pub async fn diagnostics( &mut self, request: &DiagnosticsRequest, ) -> Result<Answer>
Sourcepub async fn arm_paint_events(&mut self) -> Result<bool>
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.
Sourcepub async fn wait_for_paint(&mut self, within: Duration) -> Result<bool>
pub async fn wait_for_paint(&mut self, within: Duration) -> Result<bool>
Wait for the first real frame committed after an armed interaction.
Sourcepub async fn diagnostics_envelope(
&mut self,
request: &DiagnosticsRequest,
) -> Result<Value>
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.
pub async fn agent_envelope( &mut self, request: &AgentControlRequest, ) -> Result<Value>
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> 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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.impl<T> ErasedDestructor for Twhere
T: 'static,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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