Struct twitch_api2::helix::Response
source · [−]#[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>>,
}
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
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
sourceimpl Response<GetBroadcasterSubscriptionsRequest, Vec<BroadcasterSubscription>>
impl Response<GetBroadcasterSubscriptionsRequest, Vec<BroadcasterSubscription>>
sourcepub fn points(&self) -> Result<i64, BroadcasterSubscriptionPointsError>
pub fn points(&self) -> Result<i64, BroadcasterSubscriptionPointsError>
The current number of subscriber points earned by this broadcaster.
sourceimpl<R, D> Response<R, D> where
R: Request,
D: DeserializeOwned + PartialEq,
impl<R, D> Response<R, D> where
R: Request,
D: DeserializeOwned + PartialEq,
sourceimpl<R, D, T> Response<R, D> where
R: Request,
D: IntoIterator<Item = T> + PartialEq + DeserializeOwned,
impl<R, D, T> Response<R, D> where
R: Request,
D: IntoIterator<Item = T> + PartialEq + DeserializeOwned,
sourceimpl<R, D> Response<R, D> where
R: Request<Response = D> + Clone + Paginated + RequestGet + Debug,
D: DeserializeOwned + Debug + PartialEq,
impl<R, D> Response<R, D> where
R: Request<Response = D> + Clone + Paginated + RequestGet + Debug,
D: DeserializeOwned + Debug + PartialEq,
sourcepub async fn get_next<'a, C: HttpClient<'a>>(
self,
client: &'a HelixClient<'a, C>,
token: &impl TwitchToken + ?Sized
) -> Result<Option<Response<R, D>>, ClientRequestError<<C as HttpClient<'a>>::Error>>
Available on crate feature client
only.
pub async fn get_next<'a, C: HttpClient<'a>>(
self,
client: &'a HelixClient<'a, C>,
token: &impl TwitchToken + ?Sized
) -> Result<Option<Response<R, D>>, ClientRequestError<<C as HttpClient<'a>>::Error>>
client
only.Get the next page in the responses.
Trait Implementations
sourceimpl<R: Debug, D: Debug> Debug for Response<R, D> where
R: Request,
D: DeserializeOwned + PartialEq,
impl<R: Debug, D: Debug> Debug for Response<R, D> where
R: Request,
D: DeserializeOwned + PartialEq,
sourceimpl<R: PartialEq, D: PartialEq> PartialEq<Response<R, D>> for Response<R, D> where
R: Request,
D: DeserializeOwned + PartialEq,
impl<R: PartialEq, D: PartialEq> PartialEq<Response<R, D>> for Response<R, D> where
R: Request,
D: DeserializeOwned + PartialEq,
impl<R, D> StructuralPartialEq for Response<R, D> where
R: Request,
D: DeserializeOwned + PartialEq,
Auto Trait Implementations
impl<R, D> RefUnwindSafe for Response<R, D> where
D: RefUnwindSafe,
R: RefUnwindSafe,
impl<R, D> Send for Response<R, D> where
D: Send,
R: Send,
impl<R, D> Sync for Response<R, D> where
D: Sync,
R: Sync,
impl<R, D> Unpin for Response<R, D> where
D: Unpin,
R: Unpin,
impl<R, D> UnwindSafe for Response<R, D> where
D: UnwindSafe,
R: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more