Struct near_store::TrieChanges [−][src]
TrieChanges stores delta for refcount. Multiple versions of the state work the following way: __changes1___state1 state0 / __changes2___state2
To store state0, state1 and state2, apply insertions from changes1 and changes2
Then, to discard state2, apply insertions from changes2 as deletions
Then, to discard state0, apply deletions from changes1. deleting state0 while both state1 and state2 exist is not possible. Applying deletions from changes1 while state2 exists makes accessing state2 invalid.
create a fork -> apply insertions resolve a fork -> apply opposite of insertions discard old parent which has no forks from it -> apply deletions
Having old_root and values in deletions allows to apply TrieChanges in reverse
StoreUpdate are the changes from current state refcount to refcount + delta.
Fields
old_root: StateRoot
new_root: StateRoot
Implementations
impl TrieChanges
[src]
Trait Implementations
impl BorshDeserialize for TrieChanges where
StateRoot: BorshDeserialize,
StateRoot: BorshDeserialize,
Vec<(CryptoHash, Vec<u8>, u32)>: BorshDeserialize,
Vec<(CryptoHash, Vec<u8>, u32)>: BorshDeserialize,
[src]
StateRoot: BorshDeserialize,
StateRoot: BorshDeserialize,
Vec<(CryptoHash, Vec<u8>, u32)>: BorshDeserialize,
Vec<(CryptoHash, Vec<u8>, u32)>: BorshDeserialize,
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
[src]
pub fn try_from_slice(v: &[u8]) -> Result<Self, Error>
[src]
pub fn is_u8() -> bool
[src]
impl BorshSerialize for TrieChanges where
StateRoot: BorshSerialize,
StateRoot: BorshSerialize,
Vec<(CryptoHash, Vec<u8>, u32)>: BorshSerialize,
Vec<(CryptoHash, Vec<u8>, u32)>: BorshSerialize,
[src]
StateRoot: BorshSerialize,
StateRoot: BorshSerialize,
Vec<(CryptoHash, Vec<u8>, u32)>: BorshSerialize,
Vec<(CryptoHash, Vec<u8>, u32)>: BorshSerialize,
fn serialize<W: Write>(&self, writer: &mut W) -> Result<(), Error>
[src]
pub fn try_to_vec(&self) -> Result<Vec<u8, Global>, Error>
[src]
pub fn is_u8() -> bool
[src]
impl Clone for TrieChanges
[src]
fn clone(&self) -> TrieChanges
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for TrieChanges
[src]
impl Eq for TrieChanges
[src]
impl PartialEq<TrieChanges> for TrieChanges
[src]
fn eq(&self, other: &TrieChanges) -> bool
[src]
fn ne(&self, other: &TrieChanges) -> bool
[src]
impl StructuralEq for TrieChanges
[src]
impl StructuralPartialEq for TrieChanges
[src]
Auto Trait Implementations
impl RefUnwindSafe for TrieChanges
impl Send for TrieChanges
impl Sync for TrieChanges
impl Unpin for TrieChanges
impl UnwindSafe for TrieChanges
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,