Trait twitch_api::client::Client
source · pub trait Client: Send + Sync {
type Error: Error + Send + Sync + 'static;
// Required method
fn req(
&self,
request: Request
) -> BoxedFuture<'_, Result<Response, <Self as Client>::Error>>;
}
Available on crate feature
client
only.Expand description
A client that can do requests
Required Associated Types§
Required Methods§
Implementations on Foreign Types§
Implementors§
source§impl Client for DummyHttpClient
impl Client for DummyHttpClient
type Error = DummyHttpClient
source§impl<S, ReqBody, ResBody> Client for TowerService<S, ReqBody>where
S: Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send + Sync + 'static,
S::Error: Into<Box<dyn Error + Send + Sync>>,
S::Future: Future<Output = Result<Response<ResBody>, S::Error>> + Send + 'static,
ResBody: HttpBody + Sync + Send + 'static,
ResBody::Error: Into<Box<dyn Error + Send + Sync>>,
ResBody::Data: Sync + Send,
ReqBody: From<Bytes> + Sync + Send + 'static,
Available on crate feature tower
only.
impl<S, ReqBody, ResBody> Client for TowerService<S, ReqBody>where S: Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send + Sync + 'static, S::Error: Into<Box<dyn Error + Send + Sync>>, S::Future: Future<Output = Result<Response<ResBody>, S::Error>> + Send + 'static, ResBody: HttpBody + Sync + Send + 'static, ResBody::Error: Into<Box<dyn Error + Send + Sync>>, ResBody::Data: Sync + Send, ReqBody: From<Bytes> + Sync + Send + 'static,
Available on crate feature
tower
only.