Refactor sidecars

This commit is contained in:
2026-03-16 22:24:30 -07:00
parent f2f5726d7b
commit 053459f340
25 changed files with 674 additions and 530 deletions

View File

@@ -6,9 +6,6 @@ pub use s3::*;
pub mod misc;
use chrono::{DateTime, Utc};
use tokio_stream::wrappers::ReceiverStream;
/// A read-only set of [Item]s.
pub trait DataSource {
/// Get an item from this datasource
@@ -18,10 +15,10 @@ pub trait DataSource {
) -> impl Future<Output = Result<Option<crate::value::Item>, std::io::Error>> + Send;
/// Iterate over all items in this source in an arbitrary order
fn iter(&self) -> ReceiverStream<Result<crate::value::Item, std::io::Error>>;
fn iter(&self) -> impl Iterator<Item = &crate::value::Item>;
/// Return the time of the latest change to the data in this source
fn latest_change(
&self,
) -> impl Future<Output = Result<Option<DateTime<Utc>>, std::io::Error>> + Send;
) -> impl Future<Output = Result<Option<chrono::DateTime<chrono::Utc>>, std::io::Error>> + Send;
}