Skip to main content

collect_all

Function collect_all 

Source
pub async fn collect_all<'a, T, F, Fut>(
    fetch: F,
    limit: Option<usize>,
) -> Result<Vec<T>>
where T: 'a, F: FnMut(Option<String>) -> Fut + 'a, Fut: Future<Output = Result<Page<T>>> + 'a,
Expand description

Drains paginate into a Vec, stopping after limit items when given.

Callers should pass a limit: an unbounded drain of a large workspace both burns the request budget and multiplies query complexity (see paginate).