Trait twitch_api_rs::requests::Request [−][src]
Represents a request that can be made to the twitch api
Associated Types
type Headers: Headers
[src]
The type that represents the headers sent with this request
type Parameters: Parameters
[src]
The type that represents the query parameters sent with this request
type Body: Body
[src]
The type that represents the body of this request
type Response: Response + 'static
[src]
The type returned by a sucessful request, must be DeserializeOwned
and have at least a static lifetime (owned).
type ErrorCodes: ErrorCodes + 'static
[src]
The type that encapsulates the error codes that this endpoint can return, must have at least a static lifetime (owned).
Associated Constants
const ENDPOINT: &'static str
[src]
Endpoint where the request is made
const METHOD: Method
[src]
The method that this request will use
Required methods
fn builder() -> Self
[src]
Get a builder for this method
fn headers(&self) -> &Self::Headers
[src]
Get the Headers struct for this Request
Will only be called when Self::ready
returns Ok(())
and may not fail
in that case
fn parameters(&self) -> &Self::Parameters
[src]
Get the Parameters struct for this Request
Will only be called when Self::ready
returns Ok(())
and may not fail
in that case
fn body(&self) -> &Self::Body
[src]
Get the Body struct for this Request
Will only be called when Self::ready
returns Ok(())
and may not fail
in that case
fn ready(&self) -> Result<(), RequestError<Self::ErrorCodes>>
[src]
Must return Ok(())
if and only if this request is ready to have
Self::make_request
called on it.
Should return RequestError::MalformedRequest
with a message in the case
that the request is not ready to be sent.
Called by Self::make_request
, error is propogated.
Provided methods
#[must_use]fn make_request<'life0, 'async_trait, C>(
&'life0 self,
client: C
) -> Pin<Box<dyn Future<Output = Result<Self::Response, RequestError<Self::ErrorCodes>>> + Send + 'async_trait>> where
C: Borrow<Client> + Send,
C: 'async_trait,
'life0: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'life0 self,
client: C
) -> Pin<Box<dyn Future<Output = Result<Self::Response, RequestError<Self::ErrorCodes>>> + Send + 'async_trait>> where
C: Borrow<Client> + Send,
C: 'async_trait,
'life0: 'async_trait,
Self: Sync + 'async_trait,
Make the request represented by this object. Only makes request if Self::ready
returns
Ok(())
.
Implementors
impl Request for ClientAuthRequest
[src]
const ENDPOINT: &'static str
[src]
type Headers = ()
type Parameters = ClientAuthRequestParams
type Body = ()
type Response = ClientAuthResponse
type ErrorCodes = CommonResponseCodes
const METHOD: Method
[src]
fn builder() -> Self
[src]
fn headers(&self) -> &Self::Headers
[src]
fn parameters(&self) -> &Self::Parameters
[src]
fn body(&self) -> &Self::Body
[src]
fn ready(&self) -> Result<(), RequestError<Self::ErrorCodes>>
[src]
impl<A> Request for GetChannelInformationRequest<A> where
A: AuthToken + Sync,
[src]
A: AuthToken + Sync,
const ENDPOINT: &'static str
[src]
const METHOD: Method
[src]
type Headers = A
type Parameters = Self
type Body = ()
type Response = GetChannelInformationResponse
type ErrorCodes = CommonResponseCodes
fn builder() -> Self
[src]
fn headers(&self) -> &Self::Headers
[src]
fn parameters(&self) -> &Self::Parameters
[src]
fn body(&self) -> &Self::Body
[src]
fn ready(&self) -> Result<(), RequestError<Self::ErrorCodes>>
[src]
impl<A> Request for GetClipsRequest<A> where
A: AuthToken + Sync,
[src]
A: AuthToken + Sync,
const ENDPOINT: &'static str
[src]
const METHOD: Method
[src]
type Headers = A
type Parameters = Self
type Body = ()
type Response = GetClipsResponse
type ErrorCodes = CommonResponseCodes
fn builder() -> Self
[src]
fn headers(&self) -> &Self::Headers
[src]
fn parameters(&self) -> &Self::Parameters
[src]
fn body(&self) -> &Self::Body
[src]
fn ready(&self) -> Result<(), RequestError<Self::ErrorCodes>>
[src]
impl<A> Request for GetUsersRequest<A> where
A: AuthToken + Send,
[src]
A: AuthToken + Send,