Trait tk_http::client::Client
[−]
[src]
pub trait Client<S, F>: Sink<SinkItem = Box<Codec<S, Future = F>>> where
F: Future<Item = EncoderDone<S>, Error = Error>, { fn fetch_url(
&mut self,
url: &str
) -> Box<Future<Item = Response, Error = Error>>
where
Self::SinkError: Into<Error>; }
A marker trait that applies to a Sink that is essentially a HTTP client
It may apply to a single connection or a connection pool. For a single
connection the client::Proto
implements this interface.
We expect a boxed codec here because we assume that different kinds of
requests may be executed though same connection pool. If you want to avoid
boxing or have fine grained control, use Proto
(which is a Sink
)
directly.
Required Methods
fn fetch_url(
&mut self,
url: &str
) -> Box<Future<Item = Response, Error = Error>> where
Self::SinkError: Into<Error>,
&mut self,
url: &str
) -> Box<Future<Item = Response, Error = Error>> where
Self::SinkError: Into<Error>,
Simple fetch helper
Implementors
impl<T, S> Client<S, FutureResult<EncoderDone<S>, Error>> for T where
T: Sink<SinkItem = Box<Codec<S, Future = FutureResult<EncoderDone<S>, Error>>>>,