Skip to main content

JsonControlClient

Struct JsonControlClient 

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

Explicit JSON adapter. Construction is inert; every call opens one stream.

Implementations§

Source§

impl JsonControlClient

Source

pub fn new(path: impl AsRef<Path>) -> Self

Select legacy JSON explicitly, without probing or opening a connection.

Source

pub fn from_connector(connector: Arc<dyn Connector>) -> Self

Store a repeatable dialer without I/O or hidden negotiation.

Source

pub fn from_connector_with( connector: Arc<dyn Connector>, configure: impl FnOnce(ConnectOptions) -> ConnectOptions, ) -> ControlClientResult<Self>

Configure local deadlines without performing I/O.

Source

pub fn is_closed(&self) -> bool

Inspect shared closure, including unexpected exchange failure.

Source

pub async fn closed(&self)

Wait for shared closure. Successful per-operation JSON EOF is not a session closure; explicit close or an unexpected exchange failure is.

Source

pub async fn close(&self)

Close every clone and wake each outstanding exchange with its own admission certainty. No implicit reconnect follows an explicit close.

Source

pub async fn request( &self, message: impl IntoControlMessage, ) -> ControlClientResult<JsonReply>

Translate a known native request, returning its actual JSON reply.

Source

pub async fn request_with( &self, message: impl IntoControlMessage, configure: impl FnOnce(RequestOptions) -> RequestOptions, ) -> ControlClientResult<JsonReply>

Configure one total attempt deadline, including dial and any discovery.

Source

pub async fn request_typed<R: CheckedControlRequest>( &self, request: &R, ) -> ControlClientResult<R::Response>

Normalize a checked operation without manufacturing a CBOR response.

Source

pub async fn request_typed_with<R: CheckedControlRequest>( &self, request: &R, configure: impl FnOnce(RequestOptions) -> RequestOptions, ) -> ControlClientResult<R::Response>

Configure one checked unary attempt.

Trait Implementations§

Source§

impl Clone for JsonControlClient

Source§

fn clone(&self) -> JsonControlClient

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.