Struct ockam_node::RpcClient
source · pub struct RpcClient { /* private fields */ }Expand description
Generic client for request / response communication over a route
Implementations§
source§impl RpcClient
impl RpcClient
sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Specify a timeout for the RpcClient
sourcepub fn with_flow_controls(self, flow_controls: &FlowControls) -> Self
pub fn with_flow_controls(self, flow_controls: &FlowControls) -> Self
Specify the flow controls to use for the RpcClient
sourcepub async fn request<T, R>(&self, req: &RequestBuilder<'_, T>) -> Result<R>where
T: Encode<()>,
R: for<'a> Decode<'a, ()>,
pub async fn request<T, R>(&self, req: &RequestBuilder<'_, T>) -> Result<R>where T: Encode<()>, R: for<'a> Decode<'a, ()>,
Encode request header and body (if any) and send the package to the server.
sourcepub async fn request_no_resp_body<T>(
&self,
req: &RequestBuilder<'_, T>
) -> Result<()>where
T: Encode<()>,
pub async fn request_no_resp_body<T>( &self, req: &RequestBuilder<'_, T> ) -> Result<()>where T: Encode<()>,
Encode request header and body (if any) and send the package to the server.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for RpcClient
impl Send for RpcClient
impl Sync for RpcClient
impl Unpin for RpcClient
impl !UnwindSafe for RpcClient
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
Mutably borrows from an owned value. Read more