diff --git a/src/cache/redis_cacher.rs b/src/cache/redis_cacher.rs index 9e4cbab..8c74bac 100644 --- a/src/cache/redis_cacher.rs +++ b/src/cache/redis_cacher.rs @@ -29,6 +29,11 @@ impl RedisCache { /// * `redis_connection_url` - It takes the redis Connection url address. /// * `pool_size` - It takes the size of the connection pool (in other words the number of /// connections that should be stored in the pool). + /// + /// # Error + /// + /// Returns a newly constructed `RedisCache` struct on success otherwise returns a standard + /// error type. pub async fn new( redis_connection_url: &str, pool_size: u8, @@ -62,6 +67,11 @@ impl RedisCache { /// # Arguments /// /// * `url` - It takes an url as a string. + /// + /// # Error + /// + /// Returns the results as a String from the cache on success otherwise returns a `CacheError` + /// on a failure. pub async fn cached_json(&mut self, url: &str) -> Result> { self.current_connection = Default::default(); let hashed_url_string: &str = &self.hash_url(url); @@ -108,6 +118,11 @@ impl RedisCache { /// /// * `json_results` - It takes the json results string as an argument. /// * `url` - It takes the url as a String. + /// + /// # Error + /// + /// Returns an unit type if the results are cached succesfully otherwise returns a `CacheError` + /// on a failure. pub async fn cache_results( &mut self, json_results: &str,