/// If another page of items exists, use the 'next' URL from the current page and
/// reload the cache with the next page of items.
If another page of items exists, use the 'next' URL from the current page and
reload the cache with the next page of items.
If another page of items exists use the ' next ' URL from the current page and reload the cache with the next page of items .
fn reload_cache(&mut self) -> Result<(), SawtoothClientError> {
        if let Some(url) = &self.next.take() {
            let mut request = Client::new().get(url);
            if let Some(auth) = &self.auth {
                request = request.header("Authorization", format!("Basic {}", encode(auth)));
            }
            let response = request.send().map_err(|err| {
                SawtoothClientError::new_with_source("request failed", err.into())
            })?;
            if response.status().as_u16() == 401 {
                return Err(SawtoothClientError::new(&format!(
                    "{}, {}",
                    response.status(),
                    "failed to authenticate"
                )));
            }
            let page: Page<T> = response.json().map_err(|err| {
                SawtoothClientError::new_with_source(
                    "failed to deserialize response body",
                    err.into(),
                )
            })?;
            self.cache = page.data.into();
            self.next = page.paging.next.map(String::from);
        }
        Ok(())
    }
fn reload_cache ( & mut self ) -> Result < ( ) , SawtoothClientError > { if let Some ( url ) = & self . next . take ( ) { let mut request = Client :: new ( ) . get ( url ) ; if let Some ( auth ) = & self . auth { request = request . header ( " " , format ! ( " " encode ( auth ) ) ) ; } let response = request . send ( ) . map_err ( | err | { SawtoothClientError :: new_with_source ( " " , err . into ( ) ) } ) ? ; if response . status ( ) . as_u16 ( ) == 401 { return Err ( SawtoothClientError :: new ( & format ! ( " " response status ( ) " " ) ) ) ; } let page : Page < T > = response . json ( ) . map_err ( | err | { SawtoothClientError :: new_with_source ( " " , err . into ( ) , ) } ) ? ; self . cache = page . data . into ( ) ; self . next = page . paging . next . map ( String :: from ) ; } Ok ( ( ) ) }
If another page of items exists, use the 'next' URL from the current page and
reload the cache with the next page of items.
If another page of items exists use the ' next ' URL from the current page and reload the cache with the next page of items .
&mut self