Add server client
This commit is contained in:
@@ -17,9 +17,18 @@ pub trait DataSource {
|
||||
key: &str,
|
||||
) -> impl Future<Output = Result<Option<crate::value::Item>, std::io::Error>> + Send;
|
||||
|
||||
/// Iterate over all items in this source in an arbitrary order
|
||||
/// Iterate over all items in this source in sorted key order
|
||||
fn iter(&self) -> impl Iterator<Item = &crate::value::Item>;
|
||||
|
||||
/// Iterate over a page of items, sorted by key
|
||||
fn iter_page(
|
||||
&self,
|
||||
offset: usize,
|
||||
limit: usize,
|
||||
) -> impl Iterator<Item = &crate::value::Item> {
|
||||
self.iter().skip(offset).take(limit)
|
||||
}
|
||||
|
||||
/// Return the time of the latest change to the data in this source
|
||||
fn latest_change(
|
||||
&self,
|
||||
|
||||
Reference in New Issue
Block a user