use super::*;
pub mod request {
use super::*;
pub struct ApplicationWriteRequest {
pub message: Bytes,
pub request_id: String,
}
pub struct ApplicationReadRequest {
pub message: Bytes,
pub read_locally: bool,
}
pub struct KernelRequest {
pub message: Bytes,
}
pub struct Heartbeat {
pub leader_term: Term,
pub leader_commit_index: LogIndex,
}
pub struct AddServer {
pub server_id: NodeAddress,
}
pub struct RemoveServer {
pub server_id: NodeAddress,
}
pub struct RequestVote {
pub candidate_id: NodeAddress,
pub candidate_clock: Clock,
pub vote_term: Term,
pub force_vote: bool,
pub pre_vote: bool,
}
pub struct ReplicationStream {
pub sender_id: NodeAddress,
pub prev_clock: Clock,
pub entries: std::pin::Pin<
Box<dyn futures::stream::Stream<Item = Option<ReplicationStreamElem>> + Send>,
>,
}
pub struct ReplicationStreamElem {
pub this_clock: Clock,
pub command: Bytes,
}
}
pub mod response {
use super::*;
pub struct ReplicationStream {
pub n_inserted: u64,
pub log_last_index: LogIndex,
}
pub struct LogState {
pub head_index: LogIndex,
pub snapshot_index: LogIndex,
pub application_index: LogIndex,
pub commit_index: LogIndex,
pub last_index: LogIndex,
}
pub struct Membership {
pub members: HashSet<NodeAddress>,
}
}