Struct TrieInput
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§
§impl TrieInput
impl TrieInput
pub const fn new(
nodes: TrieUpdates,
state: HashedPostState,
prefix_sets: TriePrefixSetsMut,
) -> TrieInput
pub const fn new( nodes: TrieUpdates, state: HashedPostState, prefix_sets: TriePrefixSetsMut, ) -> TrieInput
Create new trie input.
pub fn from_state(state: HashedPostState) -> TrieInput
pub fn from_state(state: HashedPostState) -> TrieInput
Create new trie input from in-memory state. The prefix sets will be constructed and set automatically.
pub fn from_blocks<'a>(
blocks: impl IntoIterator<Item = (&'a HashedPostState, &'a TrieUpdates)>,
) -> TrieInput
pub fn from_blocks<'a>( blocks: impl IntoIterator<Item = (&'a HashedPostState, &'a TrieUpdates)>, ) -> TrieInput
Create new trie input from the provided blocks, from oldest to newest. See the documentation
for Self::extend_with_blocks for details.
pub fn from_blocks_sorted<'a>(
blocks: impl IntoIterator<Item = (&'a HashedPostStateSorted, &'a TrieUpdatesSorted)>,
) -> TrieInput
pub fn from_blocks_sorted<'a>( blocks: impl IntoIterator<Item = (&'a HashedPostStateSorted, &'a TrieUpdatesSorted)>, ) -> TrieInput
Create new trie input from the provided sorted blocks, from oldest to newest. Converts sorted types to unsorted for aggregation.
pub 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.
pub fn prepend_self(&mut self, other: TrieInput)
pub fn prepend_self(&mut self, other: TrieInput)
Prepend another trie input to the current one.
pub fn prepend(&mut self, state: HashedPostState)
pub fn prepend(&mut self, state: HashedPostState)
Prepend state to the input and extend the prefix sets.
pub 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.
pub fn append(&mut self, state: HashedPostState)
pub fn append(&mut self, state: HashedPostState)
Append state to the input and extend the prefix sets.
pub 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.
pub 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.
pub 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.
pub fn clear(&mut self)
pub fn clear(&mut self)
This method clears the trie input nodes, state, and prefix sets.
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> 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> ⓘ
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§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>,
Source§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