use std::marker::PhantomData;
use crate::RaftTypeConfig;
use crate::type_config::alias::VoteOf;
#[deprecated(
since = "0.10.0",
note = "InstallSnapshotRequest has been moved to the `openraft-legacy` crate. \
Add `openraft-legacy` to your dependencies and use \
`openraft_legacy::network_v1::InstallSnapshotRequest` instead."
)]
pub struct InstallSnapshotRequest<C>
where C: RaftTypeConfig
{
_p: PhantomData<C>,
}
#[deprecated(
since = "0.10.0",
note = "InstallSnapshotResponse has been moved to the `openraft-legacy` crate. \
Add `openraft-legacy` to your dependencies and use \
`openraft_legacy::network_v1::InstallSnapshotResponse` instead."
)]
pub struct InstallSnapshotResponse<C>
where C: RaftTypeConfig
{
_p: PhantomData<C>,
}
#[derive(Debug, Clone)]
#[derive(PartialEq, Eq)]
#[derive(derive_more::Display)]
#[display("SnapshotResponse{{vote:{}}}", vote)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize), serde(bound = ""))]
pub struct SnapshotResponse<C: RaftTypeConfig> {
pub vote: VoteOf<C>,
}
impl<C: RaftTypeConfig> SnapshotResponse<C> {
pub fn new(vote: VoteOf<C>) -> Self {
Self { vote }
}
}