Skip to content

Commit 52a63e9

Browse files
committed
Fix PaginatedKVStore interface to account for time ordering in pagination.
1 parent 49a4450 commit 52a63e9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ldk-server/src/io/paginated_kv_store.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ pub trait PaginatedKVStore {
7272
/// `primary_namespace`, ordered in descending order of `time`.
7373
///
7474
/// The `list` method returns the latest records first, based on the `time` associated with each key.
75-
/// Pagination is controlled by the `next_page_token`, which is an `Option<String>`
75+
/// Pagination is controlled by the `next_page_token`, which is an `Option<(String, i64)>`
7676
/// used to determine the starting point for the next page of results. If `next_page_token` is `None`,
7777
/// the listing starts from the most recent entry. The `next_page_token` in the returned
7878
/// [`ListResponse`] can be used to fetch the next page of results.
@@ -85,7 +85,8 @@ pub trait PaginatedKVStore {
8585
///
8686
/// [`ListResponse`]: struct.ListResponse.html
8787
fn list(
88-
&self, primary_namespace: &str, secondary_namespace: &str, next_page_token: Option<String>,
88+
&self, primary_namespace: &str, secondary_namespace: &str,
89+
next_page_token: Option<(String, i64)>,
8990
) -> Result<ListResponse, io::Error>;
9091
}
9192

@@ -98,5 +99,5 @@ pub struct ListResponse {
9899
pub keys: Vec<String>,
99100

100101
/// A token that can be used to retrieve the next set of keys.
101-
pub next_page_token: Option<String>,
102+
pub next_page_token: Option<(String, i64)>,
102103
}

0 commit comments

Comments
 (0)