haystack_server/
his_provider.rs1use std::future::Future;
7use std::pin::Pin;
8
9use chrono::{DateTime, FixedOffset};
10
11use crate::his_store::HisItem;
12
13pub trait HistoryProvider: Send + Sync + 'static {
15 fn his_read(
17 &self,
18 id: &str,
19 start: Option<DateTime<FixedOffset>>,
20 end: Option<DateTime<FixedOffset>>,
21 ) -> Pin<Box<dyn Future<Output = Vec<HisItem>> + Send + '_>>;
22
23 fn his_write(
25 &self,
26 id: &str,
27 items: Vec<HisItem>,
28 ) -> Pin<Box<dyn Future<Output = ()> + Send + '_>>;
29}