[−][src]Struct tower_hyper::client::Client
The client wrapp for hyper::Client
The generics C and B are 1-1 with the generic
types within hyper::Client.
Methods
impl<B> Client<HttpConnector, B> where
B: HttpBody + Send + 'static,
B::Data: Send,
B::Error: Into<Box<dyn Error + Send + Sync>>, [src]
B: HttpBody + Send + 'static,
B::Data: Send,
B::Error: Into<Box<dyn Error + Send + Sync>>,
impl<C, B> Client<C, B>[src]
pub fn with_client(inner: Client<C, LiftBody<B>>) -> Self[src]
Create a new client by providing the inner hyper::Client
Example
The existing default is:
use http::Request; use tower_hyper::client::Client; use tower_service::Service; let inner = hyper::Client::builder().build_http(); let mut client = Client::with_client(inner); let _ = client.call(Request::new(vec![0, 1, 2]));
which returns a Client<HttpConnector, B> for any B: HttpBody.
Trait Implementations
impl<C: Clone, B: Clone> Clone for Client<C, B>[src]
fn clone(&self) -> Client<C, B>[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl<C: Debug, B: Debug> Debug for Client<C, B>[src]
impl<C, B> Service<Request<B>> for Client<C, B> where
C: HyperConnect + Sync + 'static,
C::Transport: 'static,
C::Future: 'static,
B: HttpBody + Send + 'static,
B::Data: Send,
B::Error: Into<Box<dyn Error + Send + Sync>>, [src]
C: HyperConnect + Sync + 'static,
C::Transport: 'static,
C::Future: 'static,
B: HttpBody + Send + 'static,
B::Data: Send,
B::Error: Into<Box<dyn Error + Send + Sync>>,
type Response = Response<Body>
Responses given by the service.
type Error = Error
Errors produced by the service.
type Future = ResponseFuture<ResponseFuture>
The future response value.
fn poll_ready(&mut self) -> Poll<(), Self::Error>[src]
Poll to see if the service is ready, since hyper::Client
already handles this internally this will always return ready
fn call(&mut self, req: Request<B>) -> Self::Future[src]
Send the sepcficied request to the inner hyper::Client
Auto Trait Implementations
impl<C, B> Send for Client<C, B> where
B: Send,
C: Send + Sync,
B: Send,
C: Send + Sync,
impl<C, B> Sync for Client<C, B> where
B: Send,
C: Send + Sync,
B: Send,
C: Send + Sync,
Blanket Implementations
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> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> From<T> for 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Erased for T
impl<T, B1, B2> HttpService<B1> for T where
B2: Body,
T: Service<Request<B1>, Response = Response<B2>>, [src]
B2: Body,
T: Service<Request<B1>, Response = Response<B2>>,
type ResponseBody = B2
Response payload.
type Error = <T as Service<Request<B1>>>::Error
Errors produced by the service.
type Future = <T as Service<Request<B1>>>::Future
The future response value.
fn poll_ready(&mut self) -> Result<Async<()>, <T as HttpService<B1>>::Error>[src]
fn call(&mut self, request: Request<B1>) -> <T as HttpService<B1>>::Future[src]
fn into_service(self) -> IntoService<Self>[src]
Wrap the HttpService so that it implements tower_service::Service directly. Read more
fn as_service(&mut self) -> AsService<Self>[src]
Same as into_service but operates on an HttpService reference.