bee_ledger_types/snapshot/
kind.rs

1// Copyright 2020-2021 IOTA Stiftung
2// SPDX-License-Identifier: Apache-2.0
3
4use crate::Error;
5
6/// The kind of a snapshot.
7#[repr(u8)]
8#[derive(Debug, Copy, Clone, Eq, PartialEq, packable::Packable)]
9#[packable(unpack_error = Error)]
10#[packable(tag_type = u8, with_error = Error::InvalidSnapshotKind)]
11pub enum SnapshotKind {
12    /// Full is a snapshot which contains the full ledger entry for a given milestone plus the milestone diffs which
13    /// subtracted to the ledger milestone reduce to the snapshot milestone ledger.
14    Full = 0,
15    /// Delta is a snapshot which contains solely diffs of milestones newer than a certain ledger milestone instead of
16    /// the complete ledger state of a given milestone.
17    Delta = 1,
18}