[][src]Struct async_json_rpc::clients::http::Client

pub struct Client<S> { /* fields omitted */ }

A handle to a remote HTTP JSON-RPC server.

Implementations

impl Client<HyperClient<HttpConnector>>[src]

pub fn new(url: String, user: Option<String>, password: Option<String>) -> Self[src]

Creates a new client.

impl<S> Client<S>[src]

pub fn next_nonce(&self) -> usize[src]

impl Client<HyperClient<HttpsConnector<HttpConnector>>>[src]

pub fn new_tls(
    url: String,
    user: Option<String>,
    password: Option<String>
) -> Self
[src]

Creates a new TLS client.

impl<S> Client<S> where
    S: Service<HttpRequest<Body>, Response = HttpResponse<Body>> + Clone,
    S::Error: 'static,
    S::Future: Send + 'static, 
[src]

pub async fn send<'_>(
    &'_ self,
    request: Request
) -> Result<Response, Error<ConnectionError<S::Error>>>
[src]

Trait Implementations

impl<S: Clone> Clone for Client<S>[src]

impl<S: Debug> Debug for Client<S>[src]

impl<C> RequestFactory for Client<C>[src]

impl<S> Service<Request> for Client<S> where
    S: Service<HttpRequest<Body>, Response = HttpResponse<Body>>,
    S::Error: 'static,
    S::Future: Send + 'static, 
[src]

type Response = Response

Responses given by the service.

type Error = Error<ConnectionError<S::Error>>

Errors produced by the service.

type Future = Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>> + Send + 'static>>

The future response value.

Auto Trait Implementations

impl<S> RefUnwindSafe for Client<S> where
    S: RefUnwindSafe

impl<S> Send for Client<S> where
    S: Send

impl<S> Sync for Client<S> where
    S: Sync

impl<S> Unpin for Client<S> where
    S: Unpin

impl<S> UnwindSafe for Client<S> where
    S: UnwindSafe

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<T, Request> ServiceExt<Request> for T where
    T: Service<Request> + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.