pub struct CryptoCache { /* private fields */ }Implementations§
Source§impl CryptoCache
impl CryptoCache
Sourcepub async fn new() -> Result<Self, BrightDataError>
pub async fn new() -> Result<Self, BrightDataError>
Initialize Redis crypto cache service
Sourcepub async fn get_cached_crypto_data(
&self,
session_id: &str,
symbol: &str,
) -> Result<Option<Value>, BrightDataError>
pub async fn get_cached_crypto_data( &self, session_id: &str, symbol: &str, ) -> Result<Option<Value>, BrightDataError>
Check if cached crypto data exists and is valid
Sourcepub async fn cache_crypto_data(
&self,
session_id: &str,
symbol: &str,
data: Value,
) -> Result<(), BrightDataError>
pub async fn cache_crypto_data( &self, session_id: &str, symbol: &str, data: Value, ) -> Result<(), BrightDataError>
Cache crypto data with metadata
Sourcepub async fn get_session_crypto_symbols(
&self,
session_id: &str,
) -> Result<Vec<String>, BrightDataError>
pub async fn get_session_crypto_symbols( &self, session_id: &str, ) -> Result<Vec<String>, BrightDataError>
Get all cached crypto symbols for a session
Sourcepub async fn clear_crypto_symbol_cache(
&self,
session_id: &str,
symbol: &str,
) -> Result<(), BrightDataError>
pub async fn clear_crypto_symbol_cache( &self, session_id: &str, symbol: &str, ) -> Result<(), BrightDataError>
Clear cache for specific crypto symbol in session
Sourcepub async fn clear_session_crypto_cache(
&self,
session_id: &str,
) -> Result<u32, BrightDataError>
pub async fn clear_session_crypto_cache( &self, session_id: &str, ) -> Result<u32, BrightDataError>
Clear all crypto cache for entire session
Sourcepub async fn get_crypto_cache_stats(&self) -> Result<Value, BrightDataError>
pub async fn get_crypto_cache_stats(&self) -> Result<Value, BrightDataError>
Get crypto cache statistics
Sourcepub async fn is_crypto_cached(
&self,
session_id: &str,
symbol: &str,
) -> Result<bool, BrightDataError>
pub async fn is_crypto_cached( &self, session_id: &str, symbol: &str, ) -> Result<bool, BrightDataError>
Check if specific crypto 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_crypto_data(
&self,
session_id: &str,
crypto_data: Vec<(String, Value)>,
) -> Result<Vec<String>, BrightDataError>
pub async fn batch_cache_crypto_data( &self, session_id: &str, crypto_data: Vec<(String, Value)>, ) -> Result<Vec<String>, BrightDataError>
Batch cache multiple crypto symbols (useful for comparisons)
Trait Implementations§
Source§impl Clone for CryptoCache
impl Clone for CryptoCache
Source§fn clone(&self) -> CryptoCache
fn clone(&self) -> CryptoCache
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CryptoCache
impl RefUnwindSafe for CryptoCache
impl Send for CryptoCache
impl Sync for CryptoCache
impl Unpin for CryptoCache
impl UnwindSafe for CryptoCache
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