pub fn make_stream<'a, C: HttpClient + Send + Sync, T: TwitchToken + Send + Sync + ?Sized, Req: Request + RequestGet + Paginated + Clone + Debug + Send + Sync + 'a, Item: Send + 'a>(
req: Req,
token: &'a T,
client: &'a HelixClient<'a, C>,
fun: impl Fn(<Req as Request>::Response) -> VecDeque<Item> + Send + Sync + Copy + 'static,
) -> Pin<Box<dyn Stream<Item = Result<Item, ClientRequestError<<C as HttpClient>::Error>>> + Send + 'a>>
Available on crate features
client
and helix
only.Expand description
Make a paginate-able request into a stream
ยงExamples
use twitch_api::helix;
use futures::TryStreamExt;
let req = helix::moderation::GetModeratorsRequest::broadcaster_id("1234");
helix::make_stream(req, &token, &client, std::collections::VecDeque::from).try_collect::<Vec<_>>().await?