1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/// An account entry in the checkpoint
#[derive(Debug, Clone)]
pub enum CheckpointEntry<T> {
    /// The account has not been read or modified from the database.
    Unchanged,
    /// The recorded state of the account at this checkpoint. It may be
    /// modified or unmodified.
    Recorded(T),
}
use CheckpointEntry::*;

impl<T> CheckpointEntry<T> {
    pub fn from_cache(value: Option<T>) -> Self {
        match value {
            Some(v) => Recorded(v),
            None => Unchanged,
        }
    }
}