use crate::ids::{LogIndex, Term};
use crate::membership::ClusterConfig;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct SnapshotMeta {
pub last_included_index: LogIndex,
pub last_included_term: Term,
pub config: ClusterConfig,
}
#[derive(Debug, Clone)]
pub(crate) struct IncomingSnapshot {
pub meta: SnapshotMeta,
pub data: Vec<u8>,
}
impl IncomingSnapshot {
pub const fn new(meta: SnapshotMeta) -> Self {
Self {
meta,
data: Vec::new(),
}
}
pub fn expected_offset(&self) -> u64 {
self.data.len() as u64
}
}
#[derive(Debug, Clone)]
pub(crate) struct LoadedSnapshot {
pub meta: SnapshotMeta,
pub data: Vec<u8>,
}