diff options
author | Vika <vika@fireburn.ru> | 2023-06-22 20:28:21 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2023-06-22 20:28:21 +0300 |
commit | d61e1f6a8e5ad5b7c14b1f9ab3101496f3f9ea00 (patch) | |
tree | a8db5c905061fd25b19825a4d8aee890dd7c62b2 /kittybox-rs/src/database/file | |
parent | ff358723da641af9f4ae1f742eb1b382f4630220 (diff) | |
download | kittybox-d61e1f6a8e5ad5b7c14b1f9ab3101496f3f9ea00.tar.zst |
database: introduce read_feed_with_cursor
read_feed_with_cursor allows using an arbitrary string as a cursor, unlike read_feed_with_limit, which uses last post's UID as a cursor.
Diffstat (limited to 'kittybox-rs/src/database/file')
-rw-r--r-- | kittybox-rs/src/database/file/mod.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/kittybox-rs/src/database/file/mod.rs b/kittybox-rs/src/database/file/mod.rs index 531f7b1..a9de63e 100644 --- a/kittybox-rs/src/database/file/mod.rs +++ b/kittybox-rs/src/database/file/mod.rs @@ -499,6 +499,16 @@ impl Storage for FileStorage { } } + async fn read_feed_with_cursor( + &self, + url: &'_ str, + cursor: Option<&'_ str>, + limit: usize, + user: Option<&'_ str> + ) -> Result<Option<(serde_json::Value, Option<String>)>> { + todo!() + } + #[tracing::instrument(skip(self))] async fn read_feed_with_limit( &self, @@ -605,7 +615,7 @@ impl Storage for FileStorage { } #[tracing::instrument(skip(self))] - async fn set_setting<S: settings::Setting<'a>, 'a>(&self, user: &'_ str, value: S::Data) -> Result<()> { + async fn set_setting<S: settings::Setting<'a> + 'a, 'a>(&self, user: &'a str, value: S::Data) -> Result<()> { let url = axum::http::Uri::try_from(user).expect("Couldn't parse a URL"); let mut path = relative_path::RelativePathBuf::new(); path.push(url.authority().unwrap().to_string()); |