pub struct EtfCache { /* private fields */ }Implementations§
Source§impl EtfCache
impl EtfCache
Sourcepub async fn new() -> Result<Self, BrightDataError>
pub async fn new() -> Result<Self, BrightDataError>
Initialize Redis ETF cache service
Sourcepub async fn get_cached_etf_data(
&self,
session_id: &str,
symbol: &str,
) -> Result<Option<Value>, BrightDataError>
pub async fn get_cached_etf_data( &self, session_id: &str, symbol: &str, ) -> Result<Option<Value>, BrightDataError>
Check if cached ETF data exists and is valid
Sourcepub async fn cache_etf_data(
&self,
session_id: &str,
symbol: &str,
data: Value,
) -> Result<(), BrightDataError>
pub async fn cache_etf_data( &self, session_id: &str, symbol: &str, data: Value, ) -> Result<(), BrightDataError>
Cache ETF data with metadata
Sourcepub async fn get_session_etf_symbols(
&self,
session_id: &str,
) -> Result<Vec<String>, BrightDataError>
pub async fn get_session_etf_symbols( &self, session_id: &str, ) -> Result<Vec<String>, BrightDataError>
Get all cached ETF symbols for a session
Sourcepub async fn clear_etf_symbol_cache(
&self,
session_id: &str,
symbol: &str,
) -> Result<(), BrightDataError>
pub async fn clear_etf_symbol_cache( &self, session_id: &str, symbol: &str, ) -> Result<(), BrightDataError>
Clear cache for specific ETF symbol in session
Sourcepub async fn clear_session_etf_cache(
&self,
session_id: &str,
) -> Result<u32, BrightDataError>
pub async fn clear_session_etf_cache( &self, session_id: &str, ) -> Result<u32, BrightDataError>
Clear all ETF cache for entire session
Sourcepub async fn get_etf_cache_stats(&self) -> Result<Value, BrightDataError>
pub async fn get_etf_cache_stats(&self) -> Result<Value, BrightDataError>
Get ETF cache statistics
Sourcepub async fn is_etf_cached(
&self,
session_id: &str,
symbol: &str,
) -> Result<bool, BrightDataError>
pub async fn is_etf_cached( &self, session_id: &str, symbol: &str, ) -> Result<bool, BrightDataError>
Check if specific ETF is cached for session
Sourcepub async fn health_check(&self) -> Result<bool, BrightDataError>
pub async fn health_check(&self) -> Result<bool, BrightDataError>
Health check for Redis connection
Sourcepub async fn batch_cache_etf_data(
&self,
session_id: &str,
etf_data: Vec<(String, Value)>,
) -> Result<Vec<String>, BrightDataError>
pub async fn batch_cache_etf_data( &self, session_id: &str, etf_data: Vec<(String, Value)>, ) -> Result<Vec<String>, BrightDataError>
Batch cache multiple ETF symbols (useful for comparisons)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EtfCache
impl RefUnwindSafe for EtfCache
impl Send for EtfCache
impl Sync for EtfCache
impl Unpin for EtfCache
impl UnwindSafe for EtfCache
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more