#[non_exhaustive]pub struct Response<R, D>{
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: DTwitch’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§
Source§impl 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.
Source§impl<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>>
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>>
Get the next page in the responses.
Trait Implementations§
impl<R, D> StructuralPartialEq for Response<R, D>
Auto Trait Implementations§
impl<R, D> Freeze for Response<R, D>
impl<R, D> RefUnwindSafe for Response<R, D>where
D: RefUnwindSafe,
R: RefUnwindSafe,
impl<R, D> Send for Response<R, D>
impl<R, D> Sync for Response<R, D>
impl<R, D> Unpin for Response<R, D>
impl<R, D> UnwindSafe for Response<R, D>where
D: UnwindSafe,
R: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more