pub struct BitbucketPage<T> {
pub values: Vec<T>,
pub size: u32,
pub is_last_page: bool,
pub start: u32,
pub limit: u32,
pub next_page_start: Option<u32>,
}
Expand description
The BitbucketPage
struct represents a single page of results returned by the Bitbucket API.
It is generic over the type T
and contains a vector of values, pagination information such as the
current page size, whether this is the last page, the current page start index, the result limit,
and the index for the next page, if available.
You usually don’t need to interact with BitbucketPage
directly, as the BitbucketPaginated
iterator takes care of the pagination for you when fetching multiple pages of results.
§Example
Suppose you are fetching commits using the BitbucketClient::compare_commits()
method. The
response from the Bitbucket API will be represented as a BitbucketPage<BitbucketCommit>
.
To get the vector of BitbucketCommit
objects from the page, you can access the values
field:
use deployment_changelog::api::bitbucket::{BitbucketClient, BitbucketPage};
// Suppose you fetched a BitbucketPage<BitbucketCommit> named 'commit_page'
let commits: Vec<BitbucketCommit> = commit_page.values;
for commit in commits {
println!("{}", commit);
}
Fields§
§values: Vec<T>
§size: u32
§is_last_page: bool
§start: u32
§limit: u32
§next_page_start: Option<u32>