pub struct CachedRibbitClient { /* private fields */ }Expand description
A caching wrapper around RibbitClient for raw responses
Implementations§
Source§impl CachedRibbitClient
impl CachedRibbitClient
Sourcepub async fn with_cache_dir(region: Region, cache_dir: PathBuf) -> Result<Self>
pub async fn with_cache_dir(region: Region, cache_dir: PathBuf) -> Result<Self>
Create a new cached client with custom cache directory
Sourcepub fn set_caching_enabled(&mut self, enabled: bool)
pub fn set_caching_enabled(&mut self, enabled: bool)
Enable or disable caching
Sourcepub async fn request(&self, endpoint: &Endpoint) -> Result<Response>
pub async fn request(&self, endpoint: &Endpoint) -> Result<Response>
Make a request with caching
This method caches the raw response and reconstructs the Response object when serving from cache.
Sourcepub async fn request_raw(&self, endpoint: &Endpoint) -> Result<Vec<u8>>
pub async fn request_raw(&self, endpoint: &Endpoint) -> Result<Vec<u8>>
Make a raw request with caching
This is a convenience method that returns just the raw bytes.
Sourcepub async fn request_typed<T: TypedResponse>(
&self,
endpoint: &Endpoint,
) -> Result<T>
pub async fn request_typed<T: TypedResponse>( &self, endpoint: &Endpoint, ) -> Result<T>
Request with automatic type parsing
This method caches the raw response and parses it into the appropriate typed structure. It’s a drop-in replacement for RibbitClient::request_typed.
Sourcepub async fn get_product_versions(
&self,
product: &str,
) -> Result<ProductVersionsResponse>
pub async fn get_product_versions( &self, product: &str, ) -> Result<ProductVersionsResponse>
Request product versions with typed response
Convenience method with caching for requesting product version information.
Sourcepub async fn get_product_cdns(
&self,
product: &str,
) -> Result<ProductCdnsResponse>
pub async fn get_product_cdns( &self, product: &str, ) -> Result<ProductCdnsResponse>
Request product CDNs with typed response
Convenience method with caching for requesting CDN server information.
Sourcepub async fn get_product_bgdl(
&self,
product: &str,
) -> Result<ProductBgdlResponse>
pub async fn get_product_bgdl( &self, product: &str, ) -> Result<ProductBgdlResponse>
Request product background download config with typed response
Convenience method with caching for requesting background download configuration.
Sourcepub async fn get_summary(&self) -> Result<SummaryResponse>
pub async fn get_summary(&self) -> Result<SummaryResponse>
Request summary of all products with typed response
Convenience method with caching for requesting the summary of all available products.
Sourcepub fn inner(&self) -> &RibbitClient
pub fn inner(&self) -> &RibbitClient
Get the underlying RibbitClient
Sourcepub fn inner_mut(&mut self) -> &mut RibbitClient
pub fn inner_mut(&mut self) -> &mut RibbitClient
Get mutable access to the underlying RibbitClient
Sourcepub async fn clear_cache(&self) -> Result<()>
pub async fn clear_cache(&self) -> Result<()>
Clear all cached responses
Sourcepub async fn clear_expired(&self) -> Result<()>
pub async fn clear_expired(&self) -> Result<()>
Clear expired cache entries