fvm_std/collections/
entry_state.rs

1pub struct ValueWrapper<T> {
2    pub value: Option<T>,
3    pub state: EntryState,
4}
5
6impl<T> ValueWrapper<T> {
7    pub fn new(value: T, state: EntryState) -> Self {
8        ValueWrapper {
9            value: Some(value),
10            state,
11        }
12    }
13
14    pub fn new_empty_value(state: EntryState) -> Self {
15        ValueWrapper {
16            value: None,
17            state,
18        }
19    }
20}
21
22
23/// The state of the entry.
24#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord)]
25pub enum EntryState {
26    /// The entry's value has been changed and must be synchronized with the contract storage.
27    Changed,
28    /// The entry's value no changed.
29    NoChanged,
30    /// the entry's value is deleted
31    Deleted,
32}