use std::{collections::BTreeMap, error::Error};
type LogEntries<T> = Vec<(T, Vec<u8>)>;
pub trait LogStore<T, A, L, S, ID> {
type Error: Error;
fn get_latest_entry(
&self,
author: &A,
log_id: &L,
) -> impl Future<Output = Result<Option<T>, Self::Error>>;
fn get_latest_entry_tx(
&self,
author: &A,
log_id: &L,
) -> impl Future<Output = Result<Option<T>, Self::Error>>;
fn get_log_heights(
&self,
author: &A,
logs: &[L],
) -> impl Future<Output = Result<Option<BTreeMap<L, S>>, Self::Error>>;
fn get_log_size(
&self,
author: &A,
log_id: &L,
after: Option<S>,
until: Option<S>,
) -> impl Future<Output = Result<Option<(u64, u64)>, Self::Error>>;
fn get_log_entries(
&self,
author: &A,
log_id: &L,
after: Option<S>,
until: Option<S>,
) -> impl Future<Output = Result<Option<LogEntries<T>>, Self::Error>>;
fn prune_entries(
&self,
author: &A,
log_id: &L,
until: &S,
) -> impl Future<Output = Result<u64, Self::Error>>;
}