use bytes::Bytes;
#[allow(unused)]
use super::{super::types::Snapshot, Info, LoadSnapshotChunk};
use crate::prelude::*;
#[derive(Clone, PartialEq, Eq, Debug)]
pub struct ApplySnapshotChunk {
pub index: u32,
pub chunk: Bytes,
pub sender: String,
}
tendermint_pb_modules! {
use super::ApplySnapshotChunk;
impl From<ApplySnapshotChunk> for pb::abci::RequestApplySnapshotChunk {
fn from(apply_snapshot_chunk: ApplySnapshotChunk) -> Self {
Self {
index: apply_snapshot_chunk.index,
chunk: apply_snapshot_chunk.chunk,
sender: apply_snapshot_chunk.sender,
}
}
}
impl TryFrom<pb::abci::RequestApplySnapshotChunk> for ApplySnapshotChunk {
type Error = crate::Error;
fn try_from(apply_snapshot_chunk: pb::abci::RequestApplySnapshotChunk) -> Result<Self, Self::Error> {
Ok(Self {
index: apply_snapshot_chunk.index,
chunk: apply_snapshot_chunk.chunk,
sender: apply_snapshot_chunk.sender,
})
}
}
impl Protobuf<pb::abci::RequestApplySnapshotChunk> for ApplySnapshotChunk {}
}