From 89f34a53f7f89261bd23ebd06fb7531d6ceca101 Mon Sep 17 00:00:00 2001 From: seth Date: Wed, 6 Dec 2023 04:00:27 -0500 Subject: storage: make low level abstractions private this is to make sure we keep all the DB stuff with the DB stuff --- src/storage/mod.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/storage/mod.rs b/src/storage/mod.rs index 2ab54f6..320e79f 100644 --- a/src/storage/mod.rs +++ b/src/storage/mod.rs @@ -32,7 +32,7 @@ impl Storage { strings for keys */ - pub async fn get_key(&self, key: &str) -> Result + async fn get_key(&self, key: &str) -> Result where T: FromRedisValue, { @@ -44,7 +44,7 @@ impl Storage { Ok(res) } - pub async fn set_key<'a>( + async fn set_key<'a>( &self, key: &str, value: impl ToRedisArgs + Debug + Send + Sync + 'a, @@ -57,7 +57,7 @@ impl Storage { Ok(()) } - pub async fn key_exists(&self, key: &str) -> Result { + async fn key_exists(&self, key: &str) -> Result { debug!("Checking if key {key} exists"); let mut con = self.client.get_async_connection().await?; @@ -66,7 +66,7 @@ impl Storage { Ok(exists > 0) } - pub async fn delete_key(&self, key: &str) -> Result<()> { + async fn delete_key(&self, key: &str) -> Result<()> { debug!("Deleting key {key}"); let mut con = self.client.get_async_connection().await?; @@ -75,7 +75,7 @@ impl Storage { Ok(()) } - pub async fn expire_key(&self, key: &str, expire_seconds: usize) -> Result<()> { + async fn expire_key(&self, key: &str, expire_seconds: usize) -> Result<()> { debug!("Expiring key {key} in {expire_seconds}"); let mut con = self.client.get_async_connection().await?; @@ -84,7 +84,7 @@ impl Storage { Ok(()) } - pub async fn add_to_index<'a>( + async fn add_to_index<'a>( &self, key: &str, member: impl ToRedisArgs + Send + Sync + 'a, @@ -98,7 +98,7 @@ impl Storage { Ok(()) } - pub async fn get_from_index(&self, key: &str) -> Result> + async fn get_from_index(&self, key: &str) -> Result> where T: FromRedisValue, { -- cgit v1.2.3