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§

source

type Error: Error + Send + Sync + 'static

Error returned by the client

Required Methods§

source

fn req( &self, request: Request ) -> BoxedFuture<'_, Result<Response, <Self as Client>::Error>>

Send a request

Implementations on Foreign Types§

source§

impl Client for Client

Available on crate feature surf only.
§

type Error = SurfError

Available on crate feature client only.
source§

fn req( &self, request: Request ) -> BoxedFuture<'static, Result<Response, Self::Error>>

Available on crate feature client only.
source§

impl Client for Agent

Available on crate feature ureq only.
§

type Error = UreqError

Available on crate feature client only.
source§

fn req( &self, request: Request ) -> BoxedFuture<'static, Result<Response, Self::Error>>

Available on crate feature client only.
source§

impl<C> Client for Arc<C>where C: Client,

§

type Error = <C as Client>::Error

source§

fn req(&self, req: Request) -> BoxedFuture<'_, Result<Response, Self::Error>>

source§

impl Client for Client

Available on crate feature reqwest only.
§

type Error = Error

Available on crate feature client only.
source§

fn req( &self, request: Request ) -> BoxedFuture<'static, Result<Response, Self::Error>>

Available on crate feature client only.
source§

impl<C> Client for Box<C>where C: Client + ?Sized,

§

type Error = <C as Client>::Error

source§

fn req(&self, req: Request) -> BoxedFuture<'_, Result<Response, Self::Error>>

Implementors§

source§

impl Client for 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.