[][src]Struct easy_jsonrpc::Call

pub struct Call<'a> { /* fields omitted */ }

A single rpc method call with arguments. May be sent to the server by itself using as_request, or as a batch, using batch_request.

Methods

impl<'a> Call<'a>[src]

pub fn call<T>(method: &'a str, args: Vec<Value>) -> (Call, Tracker<T>) where
    T: Deserialize<'de>, 
[src]

Create a jsonrpc method call with a random id. T is the expected return type of the method.

pub fn notification(method: &'a str, args: Vec<Value>) -> Call[src]

Create a jsonrpc method call with no id. Jsonrpc servers accept notifications silently. That is to say, they handle the notification, but send to reasponse.

pub fn as_request(&self) -> Value[src]

Convert call to a json object which can be serialized and sent to a jsonrpc server.

pub fn batch_request(calls: &[Self]) -> Value[src]

Convert list of calls to a json object which can be serialized and sent to a jsonrpc server.

Trait Implementations

impl<'a> Debug for Call<'a>[src]

Auto Trait Implementations

impl<'a> Send for Call<'a>

impl<'a> Sync for Call<'a>

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]