pub struct TypedClient(/* private fields */);
Expand description
Client for typed JSON RPC requests
Implementations§
Source§impl TypedClient
impl TypedClient
Sourcepub fn call_method<T: Serialize, R: DeserializeOwned>(
&self,
method: &str,
returns: &str,
args: T,
) -> impl Future<Output = RpcResult<R>>
pub fn call_method<T: Serialize, R: DeserializeOwned>( &self, method: &str, returns: &str, args: T, ) -> impl Future<Output = RpcResult<R>>
Call RPC with serialization of request and deserialization of response.
Sourcepub fn notify<T: Serialize>(&self, method: &str, args: T) -> RpcResult<()>
pub fn notify<T: Serialize>(&self, method: &str, args: T) -> RpcResult<()>
Call RPC with serialization of request only.
Sourcepub fn subscribe<T: Serialize, R: DeserializeOwned + 'static>(
&self,
subscribe: &str,
subscribe_params: T,
topic: &str,
unsubscribe: &str,
returns: &'static str,
) -> RpcResult<TypedSubscriptionStream<R>>
pub fn subscribe<T: Serialize, R: DeserializeOwned + 'static>( &self, subscribe: &str, subscribe_params: T, topic: &str, unsubscribe: &str, returns: &'static str, ) -> RpcResult<TypedSubscriptionStream<R>>
Subscribe with serialization of request and deserialization of response.
Trait Implementations§
Source§impl Clone for TypedClient
impl Clone for TypedClient
Source§fn clone(&self) -> TypedClient
fn clone(&self) -> TypedClient
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl From<RpcChannel> for TypedClient
impl From<RpcChannel> for TypedClient
Source§fn from(channel: RpcChannel) -> Self
fn from(channel: RpcChannel) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for TypedClient
impl !RefUnwindSafe for TypedClient
impl Send for TypedClient
impl Sync for TypedClient
impl Unpin for TypedClient
impl !UnwindSafe for TypedClient
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