fn query_single_page(
    client: &Client,
    token: &str,
    owner: &str,
    repo: &str,
    after: Option<&str>,
) -> Box<Future<Item = (Vec<graphql::PullRequest>, PaginationState), Error = Error>> {
    Box::new(
        send_github_query(
            client,
            token,
            &Request {
                query: QUERY,
                variables: Variables { owner, repo, after },
            },
        )
        .map(|reply: graphql::Reply| {
            let prs = reply.data.repository.pull_requests.nodes;
            let next_page = match reply.data.repository.pull_requests.page_info {
                graphql::PageInfo {
                    has_next_page: true,
                    end_cursor,
                } => PaginationState::HasNext(end_cursor),
                graphql::PageInfo {
                    has_next_page: false,
                    ..
                } => PaginationState::Done,
            };
            info!(
                "Obtained {} PRs from GitHub, has next page = {}",
                prs.len(),
                !next_page.is_done()
            );
            (prs, next_page)
        }),
    )
}
/// Obtains a single page of open pull requests and associated information from GitHub.
Obtains a single page of open pull requests and associated information from GitHub.
Obtains a single page of open pull requests and associated information from GitHub .
fn query_single_page(
    client: &Client,
    token: &str,
    owner: &str,
    repo: &str,
    after: Option<&str>,
) -> Box<Future<Item = (Vec<graphql::PullRequest>, PaginationState), Error = Error>> {
    Box::new(
        send_github_query(
            client,
            token,
            &Request {
                query: QUERY,
                variables: Variables { owner, repo, after },
            },
        )
        .map(|reply: graphql::Reply| {
            let prs = reply.data.repository.pull_requests.nodes;
            let next_page = match reply.data.repository.pull_requests.page_info {
                graphql::PageInfo {
                    has_next_page: true,
                    end_cursor,
                } => PaginationState::HasNext(end_cursor),
                graphql::PageInfo {
                    has_next_page: false,
                    ..
                } => PaginationState::Done,
            };
            info!(
                "Obtained {} PRs from GitHub, has next page = {}",
                prs.len(),
                !next_page.is_done()
            );
            (prs, next_page)
        }),
    )
}
fn query_single_page ( client : & Client , token : & str , owner : & str , repo : & str , after : Option < & str > , ) -> Box < Future < Item = ( Vec < graphql :: PullRequest > , PaginationState ) , Error = Error > > { Box :: new ( send_github_query ( client , token , & Request { query : QUERY , variables : Variables { owner , repo , after } , } , ) . map ( | reply : graphql :: Reply | { let prs = reply . data . repository . pull_requests . nodes ; let next_page = match reply . data . repository . pull_requests . page_info { graphql :: PageInfo { has_next_page : true , end_cursor , } => PaginationState :: HasNext ( end_cursor ) , graphql :: PageInfo { has_next_page : false , .. } => PaginationState :: Done , } ; info ! ( " " prs len ( ) next_page is_done ( ) ) ; ( prs , next_page ) } ) , ) }
Obtains a single page of open pull requests and associated information from GitHub.
Obtains a single page of open pull requests and associated information from GitHub .
client
&Client
token
&str
owner
&str
repo
&str
after
Option<&str>
client
&Client
token
&str
owner
&str
repo
&str
after
Option<&str>