about summary refs log tree commit diff
path: root/src/database/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/database/mod.rs')
-rw-r--r--src/database/mod.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/database/mod.rs b/src/database/mod.rs
index b4b70b2..a6a3b46 100644
--- a/src/database/mod.rs
+++ b/src/database/mod.rs
@@ -215,6 +215,9 @@ pub type Result<T> = std::result::Result<T, StorageError>;
 /// or lock the database so that write conflicts or reading half-written data should not occur.
 #[async_trait]
 pub trait Storage: std::fmt::Debug + Clone + Send + Sync {
+    /// Return the list of categories used in blog posts of a specified blog.
+    async fn categories(&self, url: &str) -> Result<Vec<String>>;
+
     /// Check if a post exists in the database.
     async fn post_exists(&self, url: &str) -> Result<bool>;
 
@@ -236,7 +239,7 @@ pub trait Storage: std::fmt::Debug + Clone + Send + Sync {
     }
     /// Remove post from feed. Some database implementations might have optimized ways to do this.
     #[tracing::instrument(skip(self))]
-    async fn remove_from_feed(&self, feed: &'_ str, post: &'_ str) -> Result<()> {
+    async fn remove_from_feed(&self, feed: &str, post: &str) -> Result<()> {
         tracing::debug!("Removing {} into {} using `update_post`", post, feed);
         self.update_post(feed, serde_json::from_value(
             serde_json::json!({"delete": {"children": [post]}})).unwrap()