Struct sp_state_machine::TrieBackend[][src]

pub struct TrieBackend<S: TrieBackendStorage<H>, H: Hasher> { /* fields omitted */ }

Patricia trie-based backend. Transaction type is an overlay of changes to commit.

Implementations

impl<H: Hasher> TrieBackend<MemoryDB<H>, H> where
    H::Out: Codec + Ord
[src]

pub fn update<T: IntoIterator<Item = (Option<ChildInfo>, StorageCollection)>>(
    &self,
    changes: T
) -> Self
[src]

Copy the state, with applied updates

pub fn insert<T: IntoIterator<Item = (Option<ChildInfo>, StorageCollection)>>(
    &mut self,
    changes: T
)
[src]

Insert values into backend trie.

pub fn update_backend(&self, root: H::Out, changes: MemoryDB<H>) -> Self[src]

Merge trie nodes into this backend.

pub fn apply_transaction(&mut self, root: H::Out, transaction: MemoryDB<H>)[src]

Apply the given transaction to this backend and set the root to the given value.

pub fn eq(&self, other: &Self) -> bool[src]

Compare with another in-memory backend.

impl<S: TrieBackendStorage<H>, H: Hasher> TrieBackend<S, H> where
    H::Out: Codec
[src]

pub fn new(storage: S, root: H::Out) -> Self[src]

Create new trie-based backend.

pub fn essence(&self) -> &TrieBackendEssence<S, H>[src]

Get backend essence reference.

pub fn backend_storage(&self) -> &S[src]

Get backend storage reference.

pub fn backend_storage_mut(&mut self) -> &mut S[src]

Get backend storage reference.

pub fn root(&self) -> &H::Out[src]

Get trie root.

pub fn into_storage(self) -> S[src]

Consumes self and returns underlying storage.

Trait Implementations

impl<S: TrieBackendStorage<H>, H: Hasher> Backend<H> for TrieBackend<S, H> where
    H::Out: Ord + Codec
[src]

type Error = DefaultError

An error type when fetching data is not possible.

type Transaction = S::Overlay

Storage changes to be applied if committing

type TrieBackendStorage = S

Type of trie backend storage.

impl<H: Hasher> Clone for TrieBackend<MemoryDB<H>, H> where
    H::Out: Codec + Ord
[src]

impl<S: TrieBackendStorage<H>, H: Hasher> Debug for TrieBackend<S, H>[src]

impl<H: Hasher> Default for TrieBackend<MemoryDB<H>, H> where
    H::Out: Codec + Ord
[src]

impl<H: Hasher> From<BTreeMap<Vec<u8, Global>, Vec<u8, Global>>> for TrieBackend<MemoryDB<H>, H> where
    H::Out: Codec + Ord
[src]

impl<H: Hasher> From<HashMap<Option<ChildInfo>, BTreeMap<Vec<u8, Global>, Vec<u8, Global>>, RandomState>> for TrieBackend<MemoryDB<H>, H> where
    H::Out: Codec + Ord
[src]

impl<H: Hasher> From<Storage> for TrieBackend<MemoryDB<H>, H> where
    H::Out: Codec + Ord
[src]

impl<H: Hasher> From<Vec<(Option<ChildInfo>, Vec<(Vec<u8, Global>, Option<Vec<u8, Global>>), Global>), Global>> for TrieBackend<MemoryDB<H>, H> where
    H::Out: Codec + Ord
[src]

Auto Trait Implementations

impl<S, H> RefUnwindSafe for TrieBackend<S, H> where
    S: RefUnwindSafe,
    <H as Hasher>::Out: RefUnwindSafe
[src]

impl<S, H> Send for TrieBackend<S, H>[src]

impl<S, H> Sync for TrieBackend<S, H>[src]

impl<S, H> Unpin for TrieBackend<S, H> where
    S: Unpin,
    <H as Hasher>::Out: Unpin
[src]

impl<S, H> UnwindSafe for TrieBackend<S, H> where
    S: UnwindSafe,
    <H as Hasher>::Out: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DynClone for T where
    T: Clone
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, Outer> IsWrappedBy<Outer> for T where
    T: From<Outer>,
    Outer: AsRef<T> + AsMut<T> + From<T>, 
[src]

pub fn from_ref(outer: &Outer) -> &T[src]

Get a reference to the inner from the outer.

pub fn from_mut(outer: &mut Outer) -> &mut T[src]

Get a mutable reference to the inner from the outer.

impl<T> MaybeDebug for T where
    T: Debug
[src]

impl<T> MaybeDebug for T where
    T: Debug

impl<T> MaybeRefUnwindSafe for T where
    T: RefUnwindSafe

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<S, T> UncheckedInto<T> for S where
    T: UncheckedFrom<S>, 
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,