async fn next_async(&mut self) -> Option<EndpointResult<T, E, C>> {
            if self.batch.as_ref().is_empty() {
                // Check requested results limit and move to the next page.
                self.next_page()?;
                // Query the endpoint.
                match self.endpoint.query_async(self.client).await {
                    Err(err) => return Some(Err(err)),
                    // Update current page results and control data.
                    Ok(batch) => self.update_current_page(batch),
                };
                // Reverse the results to `pop` in FIFO order.
                self.batch.as_mut().reverse();
            }
            // Else, return the next value from current page.
            self.batch.as_mut().pop().map(Ok)
        }
// The iterator will keep yielding errors if the endpoint returns
// them indefinitely, so it is up to the caller to treat it as they
// see fit, like short-circuiting it by collecting into a Result.
The iterator will keep yielding errors if the endpoint returns
them indefinitely, so it is up to the caller to treat it as they
see fit, like short-circuiting it by collecting into a Result.
The iterator will keep yielding errors if the endpoint returns them indefinitely so it is up to the caller to treat it as they see fit like short - circuiting it by collecting into a Result .
async fn next_async(&mut self) -> Option<EndpointResult<T, E, C>> {
            if self.batch.as_ref().is_empty() {
                // Check requested results limit and move to the next page.
                self.next_page()?;
                // Query the endpoint.
                match self.endpoint.query_async(self.client).await {
                    Err(err) => return Some(Err(err)),
                    // Update current page results and control data.
                    Ok(batch) => self.update_current_page(batch),
                };
                // Reverse the results to `pop` in FIFO order.
                self.batch.as_mut().reverse();
            }
            // Else, return the next value from current page.
            self.batch.as_mut().pop().map(Ok)
        }
async fn next_async ( & mut self ) -> Option < EndpointResult < T , E , C > > { if self . batch . as_ref ( ) . is_empty ( ) { // Check requested results limit and move to the next page. self . next_page ( ) ? ; // Query the endpoint. match self . endpoint . query_async ( self . client ) . await { Err ( err ) => return Some ( Err ( err ) ) , // Update current page results and control data. Ok ( batch ) => self . update_current_page ( batch ) , } ; // Reverse the results to `pop` in FIFO order. self . batch . as_mut ( ) . reverse ( ) ; } // Else, return the next value from current page. self . batch . as_mut ( ) . pop ( ) . map ( Ok ) }
The iterator will keep yielding errors if the endpoint returns
them indefinitely, so it is up to the caller to treat it as they
see fit, like short-circuiting it by collecting into a Result.
The iterator will keep yielding errors if the endpoint returns them indefinitely so it is up to the caller to treat it as they see fit like short - circuiting it by collecting into a Result .
&mut self
&mut self