pub struct AsyncClient { /* private fields */ }Implementations§
Source§impl AsyncClient
impl AsyncClient
pub async fn connect<A: ToSocketAddrs>(addr: A) -> Result<Self>
pub async fn call_json<P: AsRef<str>, T: Serialize>( &self, path: P, body: &T, ) -> Result<Value, RepeError>
Sourcepub async fn call_json_with_timeout<P: AsRef<str>, T: Serialize>(
&self,
path: P,
body: &T,
timeout_duration: Duration,
) -> Result<Value, RepeError>
pub async fn call_json_with_timeout<P: AsRef<str>, T: Serialize>( &self, path: P, body: &T, timeout_duration: Duration, ) -> Result<Value, RepeError>
Send a JSON request and fail if no response arrives before timeout_duration.
pub async fn call_typed_json<P: AsRef<str>, T: Serialize, R: DeserializeOwned>( &self, path: P, body: &T, ) -> Result<R, RepeError>
Sourcepub async fn call_typed_json_with_timeout<P: AsRef<str>, T: Serialize, R: DeserializeOwned>(
&self,
path: P,
body: &T,
timeout_duration: Duration,
) -> Result<R, RepeError>
pub async fn call_typed_json_with_timeout<P: AsRef<str>, T: Serialize, R: DeserializeOwned>( &self, path: P, body: &T, timeout_duration: Duration, ) -> Result<R, RepeError>
Send a typed JSON request and fail if no response arrives before timeout_duration.
pub async fn call_typed_beve<P: AsRef<str>, T: Serialize, R: DeserializeOwned>( &self, path: P, body: &T, ) -> Result<R, RepeError>
Sourcepub async fn call_typed_beve_with_timeout<P: AsRef<str>, T: Serialize, R: DeserializeOwned>(
&self,
path: P,
body: &T,
timeout_duration: Duration,
) -> Result<R, RepeError>
pub async fn call_typed_beve_with_timeout<P: AsRef<str>, T: Serialize, R: DeserializeOwned>( &self, path: P, body: &T, timeout_duration: Duration, ) -> Result<R, RepeError>
Send a typed BEVE request and fail if no response arrives before timeout_duration.
Sourcepub async fn call_message<P: AsRef<str>>(
&self,
path: P,
) -> Result<Message, RepeError>
pub async fn call_message<P: AsRef<str>>( &self, path: P, ) -> Result<Message, RepeError>
Send a JSON-pointer request with an empty body and return the full response message.
This is useful for protocols that use empty-body semantics (for example, registry READs).
Sourcepub async fn call_message_with_timeout<P: AsRef<str>>(
&self,
path: P,
timeout_duration: Duration,
) -> Result<Message, RepeError>
pub async fn call_message_with_timeout<P: AsRef<str>>( &self, path: P, timeout_duration: Duration, ) -> Result<Message, RepeError>
Send a JSON-pointer request with an empty body, failing if no response arrives before
timeout_duration.
Sourcepub async fn call_with_formats<P: AsRef<str>>(
&self,
path: P,
query_format: u16,
body: Option<&[u8]>,
body_format: u16,
) -> Result<Message, RepeError>
pub async fn call_with_formats<P: AsRef<str>>( &self, path: P, query_format: u16, body: Option<&[u8]>, body_format: u16, ) -> Result<Message, RepeError>
Low-level call API that allows custom query/body format codes and optional raw body bytes.
If body is None, the request body is empty (body_length = 0).
Sourcepub async fn call_with_formats_and_timeout<P: AsRef<str>>(
&self,
path: P,
query_format: u16,
body: Option<&[u8]>,
body_format: u16,
timeout_duration: Duration,
) -> Result<Message, RepeError>
pub async fn call_with_formats_and_timeout<P: AsRef<str>>( &self, path: P, query_format: u16, body: Option<&[u8]>, body_format: u16, timeout_duration: Duration, ) -> Result<Message, RepeError>
Timeout variant of AsyncClient::call_with_formats.
Sourcepub async fn registry_read<P: AsRef<str>>(
&self,
path: P,
) -> Result<Value, RepeError>
pub async fn registry_read<P: AsRef<str>>( &self, path: P, ) -> Result<Value, RepeError>
Registry helper: send an empty-body request and decode the JSON response.
Sourcepub async fn registry_read_typed<P: AsRef<str>, R: DeserializeOwned>(
&self,
path: P,
) -> Result<R, RepeError>
pub async fn registry_read_typed<P: AsRef<str>, R: DeserializeOwned>( &self, path: P, ) -> Result<R, RepeError>
Registry helper: send an empty-body request and deserialize the JSON response as R.
Sourcepub async fn registry_read_with_timeout<P: AsRef<str>>(
&self,
path: P,
timeout_duration: Duration,
) -> Result<Value, RepeError>
pub async fn registry_read_with_timeout<P: AsRef<str>>( &self, path: P, timeout_duration: Duration, ) -> Result<Value, RepeError>
Timeout variant of AsyncClient::registry_read.
Sourcepub async fn registry_read_typed_with_timeout<P: AsRef<str>, R: DeserializeOwned>(
&self,
path: P,
timeout_duration: Duration,
) -> Result<R, RepeError>
pub async fn registry_read_typed_with_timeout<P: AsRef<str>, R: DeserializeOwned>( &self, path: P, timeout_duration: Duration, ) -> Result<R, RepeError>
Timeout variant of AsyncClient::registry_read_typed.
Sourcepub async fn registry_write_json<P: AsRef<str>, T: Serialize>(
&self,
path: P,
body: &T,
) -> Result<Value, RepeError>
pub async fn registry_write_json<P: AsRef<str>, T: Serialize>( &self, path: P, body: &T, ) -> Result<Value, RepeError>
Registry helper: send a JSON body (WRITE semantics for non-function targets).
Sourcepub async fn registry_call_json<P: AsRef<str>, T: Serialize>(
&self,
path: P,
body: &T,
) -> Result<Value, RepeError>
pub async fn registry_call_json<P: AsRef<str>, T: Serialize>( &self, path: P, body: &T, ) -> Result<Value, RepeError>
Registry helper: send a JSON body (CALL semantics for function targets).
pub async fn notify_json<P: AsRef<str>, T: Serialize>( &self, path: P, body: &T, ) -> Result<(), RepeError>
pub async fn notify_typed_json<P: AsRef<str>, T: Serialize>( &self, path: P, body: &T, ) -> Result<(), RepeError>
pub async fn notify_typed_beve<P: AsRef<str>, T: Serialize>( &self, path: P, body: &T, ) -> Result<(), RepeError>
Sourcepub async fn notify_with_formats<P: AsRef<str>>(
&self,
path: P,
query_format: u16,
body: Option<&[u8]>,
body_format: u16,
) -> Result<(), RepeError>
pub async fn notify_with_formats<P: AsRef<str>>( &self, path: P, query_format: u16, body: Option<&[u8]>, body_format: u16, ) -> Result<(), RepeError>
Low-level notify API that allows custom query/body format codes and optional raw body bytes.
If body is None, the notify request is sent with an empty body.
Sourcepub async fn forward_message(
&self,
msg: &Message,
) -> Result<Option<Message>, RepeError>
pub async fn forward_message( &self, msg: &Message, ) -> Result<Option<Message>, RepeError>
Forward a prebuilt REPE message over this connection.
This preserves the original query/body bytes, ids, notify flag, format codes, and upstream
error responses. If msg is a notify request, no response is awaited and Ok(None) is
returned.
Sourcepub async fn forward_message_with_timeout(
&self,
msg: &Message,
timeout_duration: Duration,
) -> Result<Option<Message>, RepeError>
pub async fn forward_message_with_timeout( &self, msg: &Message, timeout_duration: Duration, ) -> Result<Option<Message>, RepeError>
Timeout variant of AsyncClient::forward_message.
Trait Implementations§
Source§impl Clone for AsyncClient
impl Clone for AsyncClient
Source§fn clone(&self) -> AsyncClient
fn clone(&self) -> AsyncClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more