[−][src]Struct sp_state_machine::TrieBackend
Patricia trie-based backend. Transaction type is an overlay of changes to commit.
Methods
impl<S: TrieBackendStorage<H>, H: Hasher> TrieBackend<S, H> where
H::Out: Codec,
[src]
H::Out: Codec,
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 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]
H::Out: Ord + Codec,
type Error = String
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.
fn storage(&self, key: &[u8]) -> Result<Option<StorageValue>, Self::Error>
[src]
fn child_storage(
&self,
storage_key: &[u8],
child_info: ChildInfo,
key: &[u8]
) -> Result<Option<StorageValue>, Self::Error>
[src]
&self,
storage_key: &[u8],
child_info: ChildInfo,
key: &[u8]
) -> Result<Option<StorageValue>, Self::Error>
fn next_storage_key(
&self,
key: &[u8]
) -> Result<Option<StorageKey>, Self::Error>
[src]
&self,
key: &[u8]
) -> Result<Option<StorageKey>, Self::Error>
fn next_child_storage_key(
&self,
storage_key: &[u8],
child_info: ChildInfo,
key: &[u8]
) -> Result<Option<StorageKey>, Self::Error>
[src]
&self,
storage_key: &[u8],
child_info: ChildInfo,
key: &[u8]
) -> Result<Option<StorageKey>, Self::Error>
fn for_keys_with_prefix<F: FnMut(&[u8])>(&self, prefix: &[u8], f: F)
[src]
fn for_key_values_with_prefix<F: FnMut(&[u8], &[u8])>(
&self,
prefix: &[u8],
f: F
)
[src]
&self,
prefix: &[u8],
f: F
)
fn for_keys_in_child_storage<F: FnMut(&[u8])>(
&self,
storage_key: &[u8],
child_info: ChildInfo,
f: F
)
[src]
&self,
storage_key: &[u8],
child_info: ChildInfo,
f: F
)
fn for_child_keys_with_prefix<F: FnMut(&[u8])>(
&self,
storage_key: &[u8],
child_info: ChildInfo,
prefix: &[u8],
f: F
)
[src]
&self,
storage_key: &[u8],
child_info: ChildInfo,
prefix: &[u8],
f: F
)
fn pairs(&self) -> Vec<(StorageKey, StorageValue)>
[src]
fn keys(&self, prefix: &[u8]) -> Vec<StorageKey>
[src]
fn storage_root<I>(&self, delta: I) -> (H::Out, S::Overlay) where
I: IntoIterator<Item = (StorageKey, Option<StorageValue>)>,
[src]
I: IntoIterator<Item = (StorageKey, Option<StorageValue>)>,
fn child_storage_root<I>(
&self,
storage_key: &[u8],
child_info: ChildInfo,
delta: I
) -> (H::Out, bool, Self::Transaction) where
I: IntoIterator<Item = (StorageKey, Option<StorageValue>)>,
H::Out: Ord,
[src]
&self,
storage_key: &[u8],
child_info: ChildInfo,
delta: I
) -> (H::Out, bool, Self::Transaction) where
I: IntoIterator<Item = (StorageKey, Option<StorageValue>)>,
H::Out: Ord,
fn as_trie_backend(
&mut self
) -> Option<&TrieBackend<Self::TrieBackendStorage, H>>
[src]
&mut self
) -> Option<&TrieBackend<Self::TrieBackendStorage, H>>
fn register_overlay_stats(&mut self, _stats: &StateMachineStats)
[src]
fn usage_info(&self) -> UsageInfo
[src]
fn storage_hash(&self, key: &[u8]) -> Result<Option<H::Out>, Self::Error>
[src]
fn child_storage_hash(
&self,
storage_key: &[u8],
child_info: ChildInfo,
key: &[u8]
) -> Result<Option<H::Out>, Self::Error>
[src]
&self,
storage_key: &[u8],
child_info: ChildInfo,
key: &[u8]
) -> Result<Option<H::Out>, Self::Error>
fn exists_storage(&self, key: &[u8]) -> Result<bool, Self::Error>
[src]
fn exists_child_storage(
&self,
storage_key: &[u8],
child_info: ChildInfo,
key: &[u8]
) -> Result<bool, Self::Error>
[src]
&self,
storage_key: &[u8],
child_info: ChildInfo,
key: &[u8]
) -> Result<bool, Self::Error>
fn child_keys(
&self,
storage_key: &[u8],
child_info: ChildInfo,
prefix: &[u8]
) -> Vec<StorageKey>
[src]
&self,
storage_key: &[u8],
child_info: ChildInfo,
prefix: &[u8]
) -> Vec<StorageKey>
fn full_storage_root<I1, I2i, I2>(
&self,
delta: I1,
child_deltas: I2
) -> (H::Out, Self::Transaction) where
I1: IntoIterator<Item = (StorageKey, Option<StorageValue>)>,
I2i: IntoIterator<Item = (StorageKey, Option<StorageValue>)>,
I2: IntoIterator<Item = (StorageKey, I2i, OwnedChildInfo)>,
H::Out: Ord + Encode,
[src]
&self,
delta: I1,
child_deltas: I2
) -> (H::Out, Self::Transaction) where
I1: IntoIterator<Item = (StorageKey, Option<StorageValue>)>,
I2i: IntoIterator<Item = (StorageKey, Option<StorageValue>)>,
I2: IntoIterator<Item = (StorageKey, I2i, OwnedChildInfo)>,
H::Out: Ord + Encode,
fn wipe(&self) -> Result<(), Self::Error>
[src]
fn commit(
&self,
_storage_root: H::Out,
_transaction: Self::Transaction
) -> Result<(), Self::Error>
[src]
&self,
_storage_root: H::Out,
_transaction: Self::Transaction
) -> Result<(), Self::Error>
impl<S: TrieBackendStorage<H>, H: Hasher> Debug for TrieBackend<S, H>
[src]
Auto Trait Implementations
impl<S, H> RefUnwindSafe for TrieBackend<S, H> where
S: RefUnwindSafe,
<H as Hasher>::Out: RefUnwindSafe,
S: RefUnwindSafe,
<H as Hasher>::Out: RefUnwindSafe,
impl<S, H> Send for TrieBackend<S, H> where
<H as Hasher>::Out: Send,
<H as Hasher>::Out: Send,
impl<S, H> Sync for TrieBackend<S, H> where
<H as Hasher>::Out: Sync,
<H as Hasher>::Out: Sync,
impl<S, H> Unpin for TrieBackend<S, H> where
S: Unpin,
<H as Hasher>::Out: Unpin,
S: Unpin,
<H as Hasher>::Out: Unpin,
impl<S, H> UnwindSafe for TrieBackend<S, H> where
S: UnwindSafe,
<H as Hasher>::Out: UnwindSafe,
S: UnwindSafe,
<H as Hasher>::Out: UnwindSafe,
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,
fn borrow_mut(&mut self) -> &mut T
[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, Outer> IsWrappedBy<Outer> for T where
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
[src]
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
fn from_ref(outer: &Outer) -> &T
[src]
Get a reference to the inner from the outer.
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]
T: Debug,
impl<T> MaybeDebug for T where
T: Debug,
T: Debug,
impl<T> MaybeRefUnwindSafe for T where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Same<T> for T
type Output = T
Should always be Self
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.
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<S, T> UncheckedInto<T> for S where
T: UncheckedFrom<S>,
[src]
T: UncheckedFrom<S>,
fn unchecked_into(self) -> T
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,