Struct brontes_types::tree::BlockTree
source · pub struct BlockTree<V: NormalizedAction> {
pub tx_roots: Vec<Root<V>>,
pub header: Header,
pub priority_fee_std_dev: f64,
pub avg_priority_fee: f64,
}
Fields§
§tx_roots: Vec<Root<V>>
§header: Header
§priority_fee_std_dev: f64
§avg_priority_fee: f64
Implementations§
source§impl<V: NormalizedAction> BlockTree<V>
impl<V: NormalizedAction> BlockTree<V>
pub fn new(header: Header, tx_num: usize) -> Self
pub fn tx_must_contain_action( &self, tx_hash: B256, f: impl Fn(&V) -> bool, ) -> Option<bool>
pub fn get_tx_info_batch<DB: LibmdbxReader>( &self, tx_hash: &[B256], database: &DB, ) -> Vec<Option<TxInfo>>
pub fn get_tx_info<DB: LibmdbxReader>( &self, tx_hash: B256, database: &DB, ) -> Option<TxInfo>
pub fn get_root(&self, tx_hash: B256) -> Option<&Root<V>>
pub fn get_gas_details(&self, hash: B256) -> Option<&GasDetails>
pub fn get_prev_tx(&self, hash: B256) -> Option<B256>
pub fn insert_root(&mut self, root: Root<V>)
pub fn roots(&self) -> &[Root<V>]
pub fn finalize_tree(&mut self)
pub fn get_hashes(&self) -> Vec<B256>
sourcepub fn collect_spans(
self: Arc<Self>,
hash: B256,
call: TreeSearchBuilder<V>,
) -> TreeIterator<V, IntoIter<Vec<V>>> ⓘ
pub fn collect_spans( self: Arc<Self>, hash: B256, call: TreeSearchBuilder<V>, ) -> TreeIterator<V, IntoIter<Vec<V>>> ⓘ
Collects subsets of actions that match the action criteria specified by the closure. This is useful for collecting the subtrees of a transaction that contain the wanted actions.
sourcepub fn collect_spans_all(
self: Arc<Self>,
call: TreeSearchBuilder<V>,
) -> TreeIterator<V, IntoIter<(B256, Vec<Vec<V>>)>> ⓘ
pub fn collect_spans_all( self: Arc<Self>, call: TreeSearchBuilder<V>, ) -> TreeIterator<V, IntoIter<(B256, Vec<Vec<V>>)>> ⓘ
Collects all subsets of actions that match the action criteria specified by the closure. This is useful for collecting the subtrees of a transaction that contain the wanted actions.
sourcepub fn modify_spans<F>(&mut self, find: TreeSearchBuilder<V>, modify: F)
pub fn modify_spans<F>(&mut self, find: TreeSearchBuilder<V>, modify: F)
Collects all spans defined by the Search Args, then will allow modifications of the nodes found in the spans.
sourcepub fn collect(
self: Arc<Self>,
hash: &B256,
call: TreeSearchBuilder<V>,
) -> TreeIterator<V, IntoIter<V>> ⓘ
pub fn collect( self: Arc<Self>, hash: &B256, call: TreeSearchBuilder<V>, ) -> TreeIterator<V, IntoIter<V>> ⓘ
For the given tx hash, goes through the tree and collects all actions specified by the tree search builder.
sourcepub fn collect_all(
self: Arc<Self>,
call: TreeSearchBuilder<V>,
) -> TreeIterator<V, IntoIter<(B256, Vec<V>)>> ⓘ
pub fn collect_all( self: Arc<Self>, call: TreeSearchBuilder<V>, ) -> TreeIterator<V, IntoIter<(B256, Vec<V>)>> ⓘ
For all transactions, goes through the tree and collects all actions specified by the tree search builder.
pub fn collect_txes( self: Arc<Self>, txes: &[B256], call: TreeSearchBuilder<V>, ) -> TreeIterator<V, IntoIter<Vec<V>>> ⓘ
sourcepub fn collect_and_classify(
&mut self,
search_params: &[Option<(usize, Vec<MultiCallFrameClassification<V>>)>],
)
pub fn collect_and_classify( &mut self, search_params: &[Option<(usize, Vec<MultiCallFrameClassification<V>>)>], )
Takes Vec<(TransactionIndex, Vec<ActionIndex>
)>
for every action index of a transaction index, This function grabs all
child nodes of the action index if and only if they are specified in
the classification function of the action index node.
sourcepub fn modify_node_if_contains_childs<F>(
&mut self,
find: TreeSearchBuilder<V>,
modify: F,
)
pub fn modify_node_if_contains_childs<F>( &mut self, find: TreeSearchBuilder<V>, modify: F, )
Uses the search args to find a given nodes. Specifically if a node has childs that the search args define. Then calls the modify function on the current node.
pub fn label_private_txes(&mut self, metadata: &Metadata)
sourcepub fn remove_duplicate_data<ClassifyRemovalIndex, WantedData, R>(
&mut self,
find: TreeSearchBuilder<V>,
find_removal: TreeSearchBuilder<V>,
info: WantedData,
classify: ClassifyRemovalIndex,
)
pub fn remove_duplicate_data<ClassifyRemovalIndex, WantedData, R>( &mut self, find: TreeSearchBuilder<V>, find_removal: TreeSearchBuilder<V>, info: WantedData, classify: ClassifyRemovalIndex, )
Uses search args to collect two types of nodes. Nodes that could be a parent to a child node that we want to remove. and child nodes we want to remove. These are both collected and passed to the classifiy removal index function. This function will allow the user to look at all of the parent nodes and possible removal nodes and return the index of nodes that will be removed from the tree.
Trait Implementations§
Auto Trait Implementations§
impl<V> !Freeze for BlockTree<V>
impl<V> RefUnwindSafe for BlockTree<V>where
V: RefUnwindSafe,
impl<V> Send for BlockTree<V>
impl<V> Sync for BlockTree<V>
impl<V> Unpin for BlockTree<V>where
V: Unpin,
impl<V> UnwindSafe for BlockTree<V>where
V: UnwindSafe,
Blanket Implementations§
source§impl<T, O> ActionComparison<O> for Twhere
T: SubordinateAction<O>,
O: ActionCmp<T>,
impl<T, O> ActionComparison<O> for Twhere
T: SubordinateAction<O>,
O: ActionCmp<T>,
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Conv for T
impl<T> Conv for T
§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
§fn deserialize(
&self,
deserializer: &mut D,
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>
§impl<T, U> ExactFrom<T> for Uwhere
U: TryFrom<T>,
impl<T, U> ExactFrom<T> for Uwhere
U: TryFrom<T>,
fn exact_from(value: T) -> U
§impl<T, U> ExactInto<U> for Twhere
U: ExactFrom<T>,
impl<T, U> ExactInto<U> for Twhere
U: ExactFrom<T>,
fn exact_into(self) -> U
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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 more§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
§impl<T, U> OverflowingInto<U> for Twhere
U: OverflowingFrom<T>,
impl<T, U> OverflowingInto<U> for Twhere
U: OverflowingFrom<T>,
fn overflowing_into(self) -> (U, bool)
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T, U> RoundingInto<U> for Twhere
U: RoundingFrom<T>,
impl<T, U> RoundingInto<U> for Twhere
U: RoundingFrom<T>,
fn rounding_into(self, rm: RoundingMode) -> (U, Ordering)
§impl<T, U> SaturatingInto<U> for Twhere
U: SaturatingFrom<T>,
impl<T, U> SaturatingInto<U> for Twhere
U: SaturatingFrom<T>,
fn saturating_into(self) -> U
source§impl<T, O> SubordinateAction<O> for Twhere
O: ActionCmp<T>,
impl<T, O> SubordinateAction<O> for Twhere
O: ActionCmp<T>,
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.§impl<T> ToDebugString for Twhere
T: Debug,
impl<T> ToDebugString for Twhere
T: Debug,
§fn to_debug_string(&self) -> String
fn to_debug_string(&self) -> String
§impl<T> TryConv for T
impl<T> TryConv for T
§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>
§impl<T, U> WrappingInto<U> for Twhere
U: WrappingFrom<T>,
impl<T, U> WrappingInto<U> for Twhere
U: WrappingFrom<T>,
fn wrapping_into(self) -> U
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: 728 bytes