pub trait PagedFn<O, C, F, E>: Sized + Fn(Option<C>) -> F{
// Provided methods
fn collect<T>(self) -> impl Future<Output = Result<T, E>>
where T: Default + Extend<O> { ... }
fn stream(self) -> PagedStream<O, C, F, E, Self> { ... }
}
Expand description
A helper trait for repeatedly calling an async function which returns pages of data.
Provided Methods§
Sourcefn collect<T>(self) -> impl Future<Output = Result<T, E>>
fn collect<T>(self) -> impl Future<Output = Result<T, E>>
Get all items from the source and collect them into a vector.
Sourcefn stream(self) -> PagedStream<O, C, F, E, Self>
fn stream(self) -> PagedStream<O, C, F, E, Self>
Get a stream which will return all items from the source.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.