Skip to main content

Client

Struct Client 

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

Stateful, presentation-independent WIP client runtime.

Implementations§

Source§

impl Client

Source

pub fn new(limits: ClientLimits, wire_limits: Limits) -> Self

Creates an empty runtime with explicit state and wire bounds.

Source

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.

Source

pub fn object( &self, session: &SessionId, path: &str, ) -> Option<ObjectObservation>

Returns an object observation independently of any UI selection.

Source

pub fn known_space(&self, session: &SessionId) -> Option<Vec<ObjectObservation>>

Returns the bounded Known Space in canonical path order.

Source

pub fn tree(&self, session: &SessionId, path: &str) -> Option<&TreeObservation>

Returns one materialized lazy-tree node.

Source

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).

Source

pub fn call_history(&self, session: &SessionId) -> Option<&VecDeque<CallRecord>>

Returns operation history from oldest to newest.

Source

pub fn diagnostics(&self, session: &SessionId) -> Option<&VecDeque<Diagnostic>>

Returns diagnostic history from oldest to newest.

Source

pub fn in_flight_len(&self) -> usize

Returns the number of requests currently in flight.

Source

pub fn pending_call_context(&self, id: RequestId) -> Option<&CallContext>

Returns the immutable context of an operation that is still in flight.

Source

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.

Source

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.

Source

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.

Source

pub fn refresh_children( &mut self, session: &SessionId, path: impl Into<String>, ) -> Result<PreparedRequest, ClientError>

Explicitly refreshes one object and its direct children.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn mark_dispatched(&mut self, id: RequestId) -> Result<(), ClientError>

Marks an operation request as handed to the transport.

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Debug for Client

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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, 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, 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.