[][src]Struct octocrab::Page

#[non_exhaustive]pub struct Page<T> {
    pub items: Vec<T>,
    pub incomplete_results: Option<bool>,
    pub total_count: Option<u64>,
    pub next: Option<Url>,
    pub prev: Option<Url>,
    pub first: Option<Url>,
    pub last: Option<Url>,
}

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)

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<Url>prev: Option<Url>first: Option<Url>last: Option<Url>

Implementations

impl<T> Page<T>[src]

pub fn take_items(&mut self) -> Vec<T>[src]

Returns the current set of items, replacing it with an empty Vec.

pub fn number_of_pages(&self) -> Option<u32>[src]

If last is present, return the number of pages for this navigation.

Trait Implementations

impl<T: Clone> Clone for Page<T>[src]

impl<T: Debug> Debug for Page<T>[src]

impl<T> Default for Page<T>[src]

impl<T: DeserializeOwned> FromResponse for Page<T>[src]

impl<T> IntoIterator for Page<T>[src]

type Item = T

The type of the elements being iterated over.

type IntoIter = IntoIter<Self::Item>

Which kind of iterator are we turning this into?

Auto Trait Implementations

impl<T> RefUnwindSafe for Page<T> where
    T: RefUnwindSafe
[src]

impl<T> Send for Page<T> where
    T: Send
[src]

impl<T> Sync for Page<T> where
    T: Sync
[src]

impl<T> Unpin for Page<T> where
    T: Unpin
[src]

impl<T> UnwindSafe for Page<T> where
    T: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.