#[non_exhaustive]
pub struct Response<R, D> where
    R: Request,
    D: DeserializeOwned + PartialEq
{ pub data: D, pub pagination: Option<Cursor>, pub request: Option<R>, pub total: Option<i64>, pub other: Option<Map<String, Value>>, }
Available on crate feature helix only.
Expand description

Response retrieved from endpoint. Data is the type in Request::Response

Fields (Non-exhaustive)

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
data: D

Twitch’s response field for data.

pagination: Option<Cursor>

A cursor value, to be used in a subsequent request to specify the starting point of the next set of results.

request: Option<R>

The request that was sent, used for pagination.

total: Option<i64>

Response would return this many results if fully paginated. Sometimes this is not emmitted or correct for this purpose, in those cases, this value will be None.

other: Option<Map<String, Value>>

Fields which are not part of the data response, but are returned by the endpoint.

See for example Get Broadcaster Subscriptions which returns this.

Implementations

The current number of subscriber points earned by this broadcaster.

Get a field from the response that is not part of data.

Get first result of this response.

Available on crate feature client only.

Get the next page in the responses.

Trait Implementations

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more