use std::error::Error;
use p2panda_core::LogId;
pub trait OperationStore<T, ID> {
type Error: Error;
fn insert_operation<L: LogId>(
&self,
id: &ID,
operation: &T,
collection_id: &L,
) -> impl Future<Output = Result<bool, Self::Error>>;
fn get_operation(&self, id: &ID) -> impl Future<Output = Result<Option<T>, Self::Error>>;
fn get_operation_tx(&self, id: &ID) -> impl Future<Output = Result<Option<T>, Self::Error>>;
fn has_operation(&self, id: &ID) -> impl Future<Output = Result<bool, Self::Error>>;
fn has_operation_tx(&self, id: &ID) -> impl Future<Output = Result<bool, Self::Error>>;
fn delete_operation(&self, id: &ID) -> impl Future<Output = Result<bool, Self::Error>>;
fn delete_operation_payload(&self, id: &ID) -> impl Future<Output = Result<bool, Self::Error>>;
}