pub trait Paginator<PageType, Error>: Send + Paginatorwhere
PageType: PageableResponse,{
// Required methods
fn items(self) -> impl ItemPaginator<PageType, Error>;
fn next(
&mut self,
) -> impl Future<Output = Option<Result<PageType, Error>>> + Send;
}Expand description
Automatically streams pages in list RPCs.
When listing large collections of items Google Cloud services typically break the responses in “pages”, where each page contains a limited number of items, and a token to request the next page. The caller must repeatedly call the list RPC (using the token from the previous page) to obtain additional items.
Sequencing these calls can be tedious. The Google Cloud client libraries for Rust provide implementations of this trait to simplify the use of these paginated APIs.
Enable the unstable-stream feature to convert this type to a Stream.
For more information on the RPCs with paginated responses see AIP-4233.
Required Methods§
Sourcefn items(self) -> impl ItemPaginator<PageType, Error>
fn items(self) -> impl ItemPaginator<PageType, Error>
Creates a new ItemPaginator from an existing Paginator.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".