pub struct Client { /* private fields */ }Expand description
Stateful, presentation-independent WIP client runtime.
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(limits: ClientLimits, wire_limits: Limits) -> Self
pub fn new(limits: ClientLimits, wire_limits: Limits) -> Self
Creates an empty runtime with explicit state and wire bounds.
Sourcepub fn open_session(
&mut self,
endpoint: &str,
security_context: SecurityContext,
) -> Result<SessionId, ClientError>
pub fn open_session( &mut self, endpoint: &str, security_context: SecurityContext, ) -> Result<SessionId, ClientError>
Opens or returns a session isolated by canonical endpoint and security context.
Sourcepub fn object(
&self,
session: &SessionId,
path: &str,
) -> Option<ObjectObservation>
pub fn object( &self, session: &SessionId, path: &str, ) -> Option<ObjectObservation>
Returns an object observation independently of any UI selection.
Sourcepub fn known_space(&self, session: &SessionId) -> Option<Vec<ObjectObservation>>
pub fn known_space(&self, session: &SessionId) -> Option<Vec<ObjectObservation>>
Returns the bounded Known Space in canonical path order.
Sourcepub fn tree(&self, session: &SessionId, path: &str) -> Option<&TreeObservation>
pub fn tree(&self, session: &SessionId, path: &str) -> Option<&TreeObservation>
Returns one materialized lazy-tree node.
Sourcepub fn interface(
&self,
session: &SessionId,
reference: &InterfaceReference,
) -> Option<&InterfaceObservation>
pub fn interface( &self, session: &SessionId, reference: &InterfaceReference, ) -> Option<&InterfaceObservation>
Returns the current interface observation, isolated by session and the complete structured reference (never by display text or serialized JSON).
Sourcepub fn call_history(&self, session: &SessionId) -> Option<&VecDeque<CallRecord>>
pub fn call_history(&self, session: &SessionId) -> Option<&VecDeque<CallRecord>>
Returns operation history from oldest to newest.
Sourcepub fn diagnostics(&self, session: &SessionId) -> Option<&VecDeque<Diagnostic>>
pub fn diagnostics(&self, session: &SessionId) -> Option<&VecDeque<Diagnostic>>
Returns diagnostic history from oldest to newest.
Sourcepub fn in_flight_len(&self) -> usize
pub fn in_flight_len(&self) -> usize
Returns the number of requests currently in flight.
Sourcepub fn pending_call_context(&self, id: RequestId) -> Option<&CallContext>
pub fn pending_call_context(&self, id: RequestId) -> Option<&CallContext>
Returns the immutable context of an operation that is still in flight.
Sourcepub fn ensure_observed(
&mut self,
session: &SessionId,
path: impl Into<String>,
depth: u32,
) -> Result<Option<PreparedRequest>, ClientError>
pub fn ensure_observed( &mut self, session: &SessionId, path: impl Into<String>, depth: u32, ) -> Result<Option<PreparedRequest>, ClientError>
Ensures that an observation is available through depth without issuing
duplicate work.
Returns None when the requested coverage is already fresh, is currently
loading, is blocked by a retained failure or stale object state that requires
an explicit refresh, or when the bounded in-flight capacity is currently
full. Callers may invoke this method again after applying another completion.
Sourcepub fn ensure_children_observed(
&mut self,
session: &SessionId,
path: impl Into<String>,
) -> Result<Option<PreparedRequest>, ClientError>
pub fn ensure_children_observed( &mut self, session: &SessionId, path: impl Into<String>, ) -> Result<Option<PreparedRequest>, ClientError>
Ensures that an object’s direct children have been observed without duplicating fresh or loading work.
Sourcepub fn refresh_object(
&mut self,
session: &SessionId,
path: impl Into<String>,
) -> Result<PreparedRequest, ClientError>
pub fn refresh_object( &mut self, session: &SessionId, path: impl Into<String>, ) -> Result<PreparedRequest, ClientError>
Explicitly refreshes only one object while preserving previously observed children in Known Space.
Sourcepub fn refresh_children(
&mut self,
session: &SessionId,
path: impl Into<String>,
) -> Result<PreparedRequest, ClientError>
pub fn refresh_children( &mut self, session: &SessionId, path: impl Into<String>, ) -> Result<PreparedRequest, ClientError>
Explicitly refreshes one object and its direct children.
Sourcepub fn refresh_observed(
&mut self,
session: &SessionId,
path: impl Into<String>,
depth: u32,
) -> Result<PreparedRequest, ClientError>
pub fn refresh_observed( &mut self, session: &SessionId, path: impl Into<String>, depth: u32, ) -> Result<PreparedRequest, ClientError>
Explicitly starts or refreshes an object observation through depth.
Unlike Client::ensure_observed, this always creates a new request and
supersedes older requests for the same root path.
Sourcepub fn ensure_interface(
&mut self,
session: &SessionId,
reference: InterfaceReference,
) -> Result<Option<PreparedRequest>, ClientError>
pub fn ensure_interface( &mut self, session: &SessionId, reference: InterfaceReference, ) -> Result<Option<PreparedRequest>, ClientError>
Ensures that an interface descriptor has been observed without issuing duplicate work or evicting another cached descriptor.
Returns None when the descriptor is already fresh, is currently loading,
is blocked by retained stale or failure state that requires an explicit
refresh, or when either the interface cache or bounded in-flight capacity is
currently full. Callers may invoke this method again after applying another
completion.
Sourcepub fn prepare_interface(
&mut self,
session: &SessionId,
reference: InterfaceReference,
) -> Result<PreparedRequest, ClientError>
pub fn prepare_interface( &mut self, session: &SessionId, reference: InterfaceReference, ) -> Result<PreparedRequest, ClientError>
Explicitly starts or refreshes an interface descriptor observation.
Unlike Client::ensure_interface, this always creates a new request and
may evict an older non-loading descriptor when the interface cache is full.
Sourcepub fn prepare_call(
&mut self,
session: &SessionId,
path: &str,
interface: &InterfaceReference,
operation: impl Into<String>,
arguments: BTreeMap<String, Value>,
) -> Result<PreparedRequest, ClientError>
pub fn prepare_call( &mut self, session: &SessionId, path: &str, interface: &InterfaceReference, operation: impl Into<String>, arguments: BTreeMap<String, Value>, ) -> Result<PreparedRequest, ClientError>
Constructs an operation from fresh object and interface observations.
Membership, scope binding, both validators, the descriptor, and the operation
declaration are fixed in the returned request’s immutable CallContext.
The descriptor’s optional scope_ref is copied unchanged, never substituted
from a separate Object observation. No ancestor fetch is required. Without
a scope ref, same-path replacement cannot always be detected.
Sourcepub fn mark_dispatched(&mut self, id: RequestId) -> Result<(), ClientError>
pub fn mark_dispatched(&mut self, id: RequestId) -> Result<(), ClientError>
Marks an operation request as handed to the transport.
Sourcepub fn complete(
&mut self,
id: RequestId,
response: Response<Vec<u8>>,
) -> Result<Completion, ClientError>
pub fn complete( &mut self, id: RequestId, response: Response<Vec<u8>>, ) -> Result<Completion, ClientError>
Applies one HTTP response to the exact request identity that produced it.
Sourcepub fn fail_transport(
&mut self,
id: RequestId,
detail: impl Into<String>,
) -> Result<Completion, ClientError>
pub fn fail_transport( &mut self, id: RequestId, detail: impl Into<String>, ) -> Result<Completion, ClientError>
Records a transport failure for a request that produced no response.
Sourcepub fn fail_dispatched_call(
&mut self,
id: RequestId,
failure: DispatchedTransportFailure,
detail: impl Into<String>,
) -> Result<Completion, ClientError>
pub fn fail_dispatched_call( &mut self, id: RequestId, failure: DispatchedTransportFailure, detail: impl Into<String>, ) -> Result<Completion, ClientError>
Records a timeout or disconnect after an operation was dispatched.