pub struct TrieInput {
pub nodes: TrieUpdates,
pub state: HashedPostState,
pub prefix_sets: TriePrefixSetsMut,
}Expand description
Inputs for trie-related computations.
Fields§
§nodes: TrieUpdatesThe collection of cached in-memory intermediate trie nodes that can be reused for computation.
state: HashedPostStateThe in-memory overlay hashed state.
prefix_sets: TriePrefixSetsMutThe collection of prefix sets for the computation. Since the prefix sets always
invalidate the in-memory nodes, not all keys from self.state might be present here,
if we have cached nodes for them.
Implementations§
Source§impl TrieInput
impl TrieInput
Sourcepub const fn new(
nodes: TrieUpdates,
state: HashedPostState,
prefix_sets: TriePrefixSetsMut,
) -> Self
pub const fn new( nodes: TrieUpdates, state: HashedPostState, prefix_sets: TriePrefixSetsMut, ) -> Self
Create new trie input.
Sourcepub fn from_state(state: HashedPostState) -> Self
pub fn from_state(state: HashedPostState) -> Self
Create new trie input from in-memory state. The prefix sets will be constructed and set automatically.
Sourcepub fn from_blocks<'a>(
blocks: impl IntoIterator<Item = (&'a HashedPostState, &'a TrieUpdates)>,
) -> Self
pub fn from_blocks<'a>( blocks: impl IntoIterator<Item = (&'a HashedPostState, &'a TrieUpdates)>, ) -> Self
Create new trie input from the provided blocks, from oldest to newest. See the documentation
for Self::extend_with_blocks for details.
Sourcepub fn from_blocks_sorted<'a>(
blocks: impl IntoIterator<Item = (&'a HashedPostStateSorted, &'a TrieUpdatesSorted)>,
) -> Self
pub fn from_blocks_sorted<'a>( blocks: impl IntoIterator<Item = (&'a HashedPostStateSorted, &'a TrieUpdatesSorted)>, ) -> Self
Create new trie input from the provided sorted blocks, from oldest to newest. Converts sorted types to unsorted for aggregation.
Sourcepub fn extend_with_blocks<'a>(
&mut self,
blocks: impl IntoIterator<Item = (&'a HashedPostState, &'a TrieUpdates)>,
)
pub fn extend_with_blocks<'a>( &mut self, blocks: impl IntoIterator<Item = (&'a HashedPostState, &'a TrieUpdates)>, )
Extend the trie input with the provided blocks, from oldest to newest.
Sourcepub fn prepend_self(&mut self, other: Self)
pub fn prepend_self(&mut self, other: Self)
Prepend another trie input to the current one.
Sourcepub fn prepend(&mut self, state: HashedPostState)
pub fn prepend(&mut self, state: HashedPostState)
Prepend state to the input and extend the prefix sets.
Sourcepub fn prepend_cached(&mut self, nodes: TrieUpdates, state: HashedPostState)
pub fn prepend_cached(&mut self, nodes: TrieUpdates, state: HashedPostState)
Prepend intermediate nodes and state to the input. Prefix sets for incoming state will be ignored.
Sourcepub fn append(&mut self, state: HashedPostState)
pub fn append(&mut self, state: HashedPostState)
Append state to the input and extend the prefix sets.
Sourcepub fn append_ref(&mut self, state: &HashedPostState)
pub fn append_ref(&mut self, state: &HashedPostState)
Append state to the input by reference and extend the prefix sets.
Sourcepub fn append_cached(&mut self, nodes: TrieUpdates, state: HashedPostState)
pub fn append_cached(&mut self, nodes: TrieUpdates, state: HashedPostState)
Append intermediate nodes and state to the input. Prefix sets for incoming state will be ignored.
Sourcepub fn append_cached_ref(
&mut self,
nodes: &TrieUpdates,
state: &HashedPostState,
)
pub fn append_cached_ref( &mut self, nodes: &TrieUpdates, state: &HashedPostState, )
Append intermediate nodes and state to the input by reference. Prefix sets for incoming state will be ignored.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TrieInput
impl RefUnwindSafe for TrieInput
impl Send for TrieInput
impl Sync for TrieInput
impl Unpin for TrieInput
impl UnsafeUnpin for TrieInput
impl UnwindSafe for TrieInput
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> MaybeDebug for Twhere
T: Debug,
§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 312 bytes