Struct sp_state_machine::ChangesTrieBuildCache [−][src]
Changes trie build cache.
Helps to avoid read of changes tries from the database when digest trie is built. It holds changed keys for every block (indexed by changes trie root) that could be referenced by future digest items. For digest entries it also holds keys covered by this digest. Entries for top level digests are never created, because they'll never be used to build other digests.
Entries are pruned from the cache once digest block that is using this entry is inserted (because digest block will includes all keys from this entry). When there's a fork, entries are pruned when first changes trie is inserted.
Implementations
impl<H, N> BuildCache<H, N> where
N: Eq + Hash,
H: Eq + Hash + Clone,
[src]
N: Eq + Hash,
H: Eq + Hash + Clone,
pub fn new() -> Self
[src]
Create new changes trie build cache.
pub fn get(
&self,
root: &H
) -> Option<&HashMap<Option<PrefixedStorageKey>, HashSet<StorageKey>>>
[src]
&self,
root: &H
) -> Option<&HashMap<Option<PrefixedStorageKey>, HashSet<StorageKey>>>
Get cached changed keys for changes trie with given root.
pub fn with_changed_keys(
&self,
root: &H,
functor: &mut dyn FnMut(&HashMap<Option<PrefixedStorageKey>, HashSet<StorageKey>>)
) -> bool
[src]
&self,
root: &H,
functor: &mut dyn FnMut(&HashMap<Option<PrefixedStorageKey>, HashSet<StorageKey>>)
) -> bool
Execute given functor with cached entry for given block. Returns true if the functor has been called and false otherwise.
pub fn perform(&mut self, action: CacheAction<H, N>)
[src]
Insert data into cache.
Auto Trait Implementations
impl<H, N> RefUnwindSafe for BuildCache<H, N> where
H: RefUnwindSafe,
N: RefUnwindSafe,
[src]
H: RefUnwindSafe,
N: RefUnwindSafe,
impl<H, N> Send for BuildCache<H, N> where
H: Send,
N: Send,
[src]
H: Send,
N: Send,
impl<H, N> Sync for BuildCache<H, N> where
H: Sync,
N: Sync,
[src]
H: Sync,
N: Sync,
impl<H, N> Unpin for BuildCache<H, N> where
H: Unpin,
N: Unpin,
[src]
H: Unpin,
N: Unpin,
impl<H, N> UnwindSafe for BuildCache<H, N> where
H: UnwindSafe,
N: UnwindSafe,
[src]
H: UnwindSafe,
N: 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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, Outer> IsWrappedBy<Outer> for T where
T: From<Outer>,
Outer: AsRef<T> + AsMut<T> + From<T>,
[src]
T: From<Outer>,
Outer: AsRef<T> + AsMut<T> + From<T>,
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> 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.
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<S, T> UncheckedInto<T> for S where
T: UncheckedFrom<S>,
[src]
T: UncheckedFrom<S>,
pub fn unchecked_into(self) -> T
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,