diff options
| author | seth <[email protected]> | 2023-12-06 04:00:27 -0500 |
|---|---|---|
| committer | seth <[email protected]> | 2023-12-15 16:41:13 -0500 |
| commit | 89f34a53f7f89261bd23ebd06fb7531d6ceca101 (patch) | |
| tree | 070a2171c8e39d521ae47c263119d965ab55c3f8 /src/storage | |
| parent | 904259063831738d357a8092bee7c0e30988b0f6 (diff) | |
storage: make low level abstractions private
this is to make sure we keep all the DB stuff with the DB stuff
Diffstat (limited to 'src/storage')
| -rw-r--r-- | src/storage/mod.rs | 14 |
1 files changed, 7 insertions, 7 deletions
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<T>(&self, key: &str) -> Result<T> + async fn get_key<T>(&self, key: &str) -> Result<T> 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<bool> { + async fn key_exists(&self, key: &str) -> Result<bool> { 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<T>(&self, key: &str) -> Result<Vec<T>> + async fn get_from_index<T>(&self, key: &str) -> Result<Vec<T>> where T: FromRedisValue, { |
