Struct eth_state_fold::StateFoldEnvironment
source · pub struct StateFoldEnvironment<M: Middleware, UD> {
pub block_archive: Option<Arc<BlockArchive<M>>>,
pub safety_margin: usize,
/* private fields */
}Fields§
§block_archive: Option<Arc<BlockArchive<M>>>§safety_margin: usizeImplementations§
source§impl<M: Middleware + 'static, UD> StateFoldEnvironment<M, UD>
impl<M: Middleware + 'static, UD> StateFoldEnvironment<M, UD>
pub fn new( inner_middleware: Arc<M>, block_archive: Option<Arc<BlockArchive<M>>>, safety_margin: usize, genesis_block: U64, query_limit_error_codes: Vec<i32>, concurrent_events_fetch: usize, maximum_events_per_response: usize, user_data: UD ) -> Self
pub fn user_data(&self) -> &UD
pub fn inner_middleware(&self) -> Arc<M>
pub async fn get_state_for_block<F: Foldable<UserData = UD> + Send + Sync + 'static>( &self, initial_state: &F::InitialState, fold_block: QueryBlock ) -> Result<BlockState<F>, FoldableError<M, F>>
source§impl<M: Middleware + 'static, UD> StateFoldEnvironment<M, UD>
impl<M: Middleware + 'static, UD> StateFoldEnvironment<M, UD>
Internals
pub async fn block_with_hash( &self, hash: &H256 ) -> Result<Arc<Block>, BlockArchiveError<M>>
pub async fn block_with_number( &self, number: U64 ) -> Result<Arc<Block>, BlockArchiveError<M>>
Auto Trait Implementations§
impl<M, UD> !RefUnwindSafe for StateFoldEnvironment<M, UD>
impl<M, UD> Send for StateFoldEnvironment<M, UD>where UD: Send,
impl<M, UD> Sync for StateFoldEnvironment<M, UD>where UD: Sync,
impl<M, UD> Unpin for StateFoldEnvironment<M, UD>where UD: Unpin,
impl<M, UD> !UnwindSafe for StateFoldEnvironment<M, UD>
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
Mutably borrows from an owned value. Read more