pub struct ExampleRpcClient<T: Transport> { /* private fields */ }
Expand description
Just an example RPC client to showcase how to use the jsonrpc_client
macro and what
the resulting structs look like.
Implementations§
Source§impl<T: Transport> ExampleRpcClient<T>
impl<T: Transport> ExampleRpcClient<T>
Sourcepub fn new(transport: T) -> Self
pub fn new(transport: T) -> Self
Creates a new RPC client backed by the given transport implementation.
Sourcepub fn nullary(&mut self) -> RpcRequest<(), T::Future>
pub fn nullary(&mut self) -> RpcRequest<(), T::Future>
A method without any arguments and with no return value. Can still of course have lots of side effects on the server where it executes.
Sourcepub fn echo(&mut self, input: &str) -> RpcRequest<String, T::Future>
pub fn echo(&mut self, input: &str) -> RpcRequest<String, T::Future>
Send a string to the server and it will presumably echo it back.
Sourcepub fn concat(
&mut self,
arg0: String,
arg1: u64,
) -> RpcRequest<String, T::Future>
pub fn concat( &mut self, arg0: String, arg1: u64, ) -> RpcRequest<String, T::Future>
Example RPC method named “concat” that takes a String
and an unsigned integer and
returns a String
. From the name one could guess it will concatenate the two
arguments. But that of course depends on the server where this call is sent.
Auto Trait Implementations§
impl<T> Freeze for ExampleRpcClient<T>where
T: Freeze,
impl<T> RefUnwindSafe for ExampleRpcClient<T>where
T: RefUnwindSafe,
impl<T> Send for ExampleRpcClient<T>where
T: Send,
impl<T> Sync for ExampleRpcClient<T>where
T: Sync,
impl<T> Unpin for ExampleRpcClient<T>where
T: Unpin,
impl<T> UnwindSafe for ExampleRpcClient<T>where
T: UnwindSafe,
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