use std::fmt::Debug;
use std::io;
use openraft_macros::add_async_trait;
use openraft_macros::since;
use crate::OptionalSend;
use crate::RaftTypeConfig;
use crate::storage::RaftLogStorage;
use crate::storage::RaftStateMachine;
use crate::testing::log::StoreBuilder;
#[add_async_trait]
#[since(version = "0.10.1")]
pub trait ApplicationStoreBuilder<C, LS, SM, G = ()>: StoreBuilder<C, LS, SM, G>
where
C: RaftTypeConfig,
LS: RaftLogStorage<C>,
SM: RaftStateMachine<C>,
{
#[since(version = "0.10.1")]
type State: Debug + Eq + OptionalSend;
#[since(version = "0.10.1")]
fn entries(&self) -> Vec<C::Entry>;
#[since(version = "0.10.1")]
fn expected_responses(&self) -> Vec<C::R>;
#[since(version = "0.10.1")]
fn expected_state(&self) -> Self::State;
#[since(version = "0.10.1")]
async fn read_state(&self, state_machine: &mut SM) -> Result<Self::State, io::Error>;
}