use std::io::Cursor;
use crate::cmd::{Cmd, CmdResult};
pub type NodeId = u64;
pub type Node = openraft::BasicNode;
pub type SnapshotData = Cursor<Vec<u8>>;
openraft::declare_raft_types!(
pub TypeConfig:
D = Cmd,
R = CmdResult,
);
pub type MocraRaft = openraft::Raft<TypeConfig>;
pub mod typ {
use openraft::error::Infallible;
use super::{Node, NodeId, TypeConfig};
pub type Entry = openraft::Entry<TypeConfig>;
pub type RaftError<E = Infallible> = openraft::error::RaftError<NodeId, E>;
pub type RPCError<E = Infallible> = openraft::error::RPCError<NodeId, Node, RaftError<E>>;
pub type ClientWriteError = openraft::error::ClientWriteError<NodeId, Node>;
pub type InitializeError = openraft::error::InitializeError<NodeId, Node>;
pub type ClientWriteResponse = openraft::raft::ClientWriteResponse<TypeConfig>;
}