use crate::{ContextEvent, ContextEvents, ContextSnapshot, ContextStorage};
pub trait ContextStorageStream: ContextStorage {
type Cursor: Clone + Send;
type Events: ContextEvents<Cursor = Self::Cursor, Error = Self::Error> + Send;
fn subscribe(
&self,
spec: &Self::Slice,
from: Option<Self::Cursor>,
) -> impl Future<Output = Result<(ContextSnapshot, Self::Events), Self::Error>> + Send;
fn apply(
&self,
event: &ContextEvent,
) -> impl Future<Output = Result<Self::Cursor, Self::Error>> + Send;
fn apply_batch(
&self,
events: &[ContextEvent],
) -> impl Future<Output = Result<Self::Cursor, Self::Error>> + Send;
}