#[non_exhaustive]pub struct Page<T> {
pub items: Vec<T>,
pub incomplete_results: Option<bool>,
pub total_count: Option<u64>,
pub next: Option<Uri>,
pub prev: Option<Uri>,
pub first: Option<Uri>,
pub last: Option<Uri>,
}
Expand description
A Page of GitHub results, with links to the next and previous page.
let octocrab = octocrab::instance();
// Print the titles of the first page of issues.
for issue in octocrab.issues("rust-lang", "rust").list().send().await? {
println!("{}", issue.title);
}
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.items: Vec<T>
§incomplete_results: Option<bool>
§total_count: Option<u64>
§next: Option<Uri>
§prev: Option<Uri>
§first: Option<Uri>
§last: Option<Uri>
Implementations§
source§impl<T> Page<T>
impl<T> Page<T>
sourcepub fn take_items(&mut self) -> Vec<T>
pub fn take_items(&mut self) -> Vec<T>
Returns the current set of items, replacing it with an empty Vec.
sourcepub fn number_of_pages(&self) -> Option<u32>
pub fn number_of_pages(&self) -> Option<u32>
If last
is present, return the number of pages for this navigation.
Trait Implementations§
source§impl<T: DeserializeOwned> FromResponse for Page<T>
impl<T: DeserializeOwned> FromResponse for Page<T>
source§impl<'iter, T> IntoIterator for &'iter Page<T>
impl<'iter, T> IntoIterator for &'iter Page<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for Page<T>where
T: RefUnwindSafe,
impl<T> Send for Page<T>where
T: Send,
impl<T> Sync for Page<T>where
T: Sync,
impl<T> Unpin for Page<T>where
T: Unpin,
impl<T> UnwindSafe for Page<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more