Trait Paginatable

Source
pub trait Paginatable<R: DeserializeOwned + Debug + HasPaginationKey + MergePage>: JQuantsBuilder<R> + Clone {
    // Required method
    fn pagination_key(self, pagination_key: impl Into<String>) -> Self;

    // Provided methods
    fn fetch_pages_stream(self) -> impl Stream<Item = Result<R, JQuantsError>> { ... }
    fn fetch_all(self) -> impl Future<Output = Result<Vec<R>, JQuantsError>> { ... }
    fn fetch_all_and_merge(
        self,
    ) -> impl Future<Output = Result<R, JQuantsError>> { ... }
}
Expand description

Trait for paginatable responses.

Required Methods§

Source

fn pagination_key(self, pagination_key: impl Into<String>) -> Self

Set the pagination key.

Provided Methods§

Source

fn fetch_pages_stream(self) -> impl Stream<Item = Result<R, JQuantsError>>

Fetch the pages stream.

Source

fn fetch_all(self) -> impl Future<Output = Result<Vec<R>, JQuantsError>>

Fetch all pages.

Source

fn fetch_all_and_merge(self) -> impl Future<Output = Result<R, JQuantsError>>

Fetch all pages and merge them.

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.

Implementors§