Struct fc_rpc::EthBlockDataCacheTask
source · pub struct EthBlockDataCacheTask<B: BlockT>(/* private fields */);
Expand description
Manage LRU caches for block data and their transaction statuses. These are large and take a lot of time to fetch from the database. Storing them in an LRU cache will allow to reduce database accesses when many subsequent requests are related to the same blocks.
Implementations§
source§impl<B: BlockT> EthBlockDataCacheTask<B>
impl<B: BlockT> EthBlockDataCacheTask<B>
pub fn new( spawn_handle: SpawnTaskHandle, overrides: Arc<OverrideHandle<B>>, blocks_cache_max_size: usize, statuses_cache_max_size: usize, prometheus_registry: Option<Registry> ) -> Self
sourcepub async fn current_block(
&self,
schema: EthereumStorageSchema,
block_hash: B::Hash
) -> Option<EthereumBlock>
pub async fn current_block( &self, schema: EthereumStorageSchema, block_hash: B::Hash ) -> Option<EthereumBlock>
Cache for handler.current_block
.
sourcepub async fn current_transaction_statuses(
&self,
schema: EthereumStorageSchema,
block_hash: B::Hash
) -> Option<Vec<TransactionStatus>>
pub async fn current_transaction_statuses( &self, schema: EthereumStorageSchema, block_hash: B::Hash ) -> Option<Vec<TransactionStatus>>
Cache for handler.current_transaction_statuses
.
Auto Trait Implementations§
impl<B> !RefUnwindSafe for EthBlockDataCacheTask<B>
impl<B> Send for EthBlockDataCacheTask<B>
impl<B> Sync for EthBlockDataCacheTask<B>
impl<B> Unpin for EthBlockDataCacheTask<B>
impl<B> !UnwindSafe for EthBlockDataCacheTask<B>
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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
§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
§fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
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> 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>
§impl<T> IsType<T> for T
impl<T> IsType<T> for T
§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of
T
. Read more§impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
type Error = <U as TryFromKey<T>>::Error
fn try_into_key(self) -> Result<U, <U as TryFromKey<T>>::Error>
§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from
.§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of
T
.