use anyerror::AnyError;
use crate::{LogEntry};
pub trait LogWriter: Send + Sync {
fn append_entry(&mut self, entry: LogEntry) -> impl std::future::Future<Output = Result<(), AnyError>> + Send;
fn truncate_prefix(&mut self, first_log_index_kept: usize) -> impl std::future::Future<Output = Result<Option<usize>, AnyError>> + Send;
fn truncate_suffix(&mut self, last_log_index_kept: usize) -> impl std::future::Future<Output = Result<Option<usize>, AnyError>> + Send;
fn reset(&mut self, next_log_index: usize) -> impl std::future::Future<Output = Result<(), AnyError>> + Send;
fn flush(&mut self) -> impl std::future::Future<Output = Result<(), AnyError>> + Send;
}