[−][src]Struct async_json_rpc::clients::http::Client
A handle to a remote HTTP JSON-RPC server.
Implementations
impl<S> Client<S>
[src]
pub fn from_service(
service: S,
url: String,
user: Option<String>,
password: Option<String>
) -> Self
[src]
service: S,
url: String,
user: Option<String>,
password: Option<String>
) -> Self
Creates a new HTTP client from a Service
.
pub fn next_nonce(&self) -> usize
[src]
Increment nonce and return the last value.
impl Client<HyperClient<HttpConnector>>
[src]
pub fn new(url: String, user: Option<String>, password: Option<String>) -> Self
[src]
Creates a new HTTP client.
impl Client<HyperClient<HttpsConnector<HttpConnector>>>
[src]
pub fn new_tls(
url: String,
user: Option<String>,
password: Option<String>
) -> Self
[src]
url: String,
user: Option<String>,
password: Option<String>
) -> Self
Creates a new HTTPS client.
impl<S> Client<S> where
S: Service<HttpRequest<Body>, Response = HttpResponse<Body>> + Clone,
S::Error: 'static,
S::Future: Send + 'static,
[src]
S: Service<HttpRequest<Body>, Response = HttpResponse<Body>> + Clone,
S::Error: 'static,
S::Future: Send + 'static,
pub async fn send<'_>(
&'_ self,
request: Request
) -> Result<Response, Error<ConnectionError<S::Error>>>
[src]
&'_ self,
request: Request
) -> Result<Response, Error<ConnectionError<S::Error>>>
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]
fn build_request(&self) -> RequestBuilder
[src]
Build the request.
impl<S> Service<Request> for Client<S> where
S: Service<HttpRequest<Body>, Response = HttpResponse<Body>>,
S::Error: 'static,
S::Future: Send + 'static,
[src]
S: Service<HttpRequest<Body>, Response = HttpResponse<Body>>,
S::Error: 'static,
S::Future: Send + 'static,
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.
fn poll_ready(&mut self, cx: &mut Context) -> Poll<Result<(), Self::Error>>
[src]
fn call(&mut self, request: Request) -> Self::Future
[src]
Auto Trait Implementations
impl<S> RefUnwindSafe for Client<S> where
S: RefUnwindSafe,
S: RefUnwindSafe,
impl<S> Send for Client<S> where
S: Send,
S: Send,
impl<S> Sync for Client<S> where
S: Sync,
S: Sync,
impl<S> Unpin for Client<S> where
S: Unpin,
S: Unpin,
impl<S> UnwindSafe for Client<S> where
S: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, Request> ServiceExt<Request> for T where
T: Service<Request> + ?Sized,
[src]
T: Service<Request> + ?Sized,
fn ready(&mut self) -> Ready<Self, Request>
[src]
fn ready_and(&mut self) -> ReadyAnd<Self, Request>
[src]
fn ready_oneshot(self) -> ReadyOneshot<Self, Request>
[src]
fn oneshot(self, req: Request) -> Oneshot<Self, Request>
[src]
fn call_all<S>(self, reqs: S) -> CallAll<Self, S> where
S: Stream<Item = Request>,
Self::Error: Into<Box<dyn Error + 'static + Sync + Send>>,
[src]
S: Stream<Item = Request>,
Self::Error: Into<Box<dyn Error + 'static + Sync + Send>>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,