pub struct CachedReadsDbMut<'a, DB> {
pub cached: &'a mut CachedReads,
pub db: DB,
}Expand description
A Database that caches reads inside CachedReads.
The lifetime parameter 'a is tied to the lifetime of the underlying CachedReads instance.
This ensures that the cache remains valid for the entire duration this wrapper is used.
The original CachedReads must outlive this wrapper to prevent use-after-free.
Fields§
§cached: &'a mut CachedReadsThe cache of reads.
db: DBThe underlying database.
Implementations§
Trait Implementations§
Source§impl<DB, T> AsRef<T> for CachedReadsDbMut<'_, DB>where
DB: AsRef<T>,
impl<DB, T> AsRef<T> for CachedReadsDbMut<'_, DB>where
DB: AsRef<T>,
Source§impl<DB: Database> Database for CachedReadsDbMut<'_, DB>
impl<DB: Database> Database for CachedReadsDbMut<'_, DB>
Source§fn is_fatal(error: &Self::Error) -> bool
fn is_fatal(error: &Self::Error) -> bool
Whether a concrete database error is an internal failure rather than invalid input.
Source§fn get_account(
&mut self,
address: &Address,
) -> Result<Option<AccountInfo>, Self::Error>
fn get_account( &mut self, address: &Address, ) -> Result<Option<AccountInfo>, Self::Error>
Loads account information.
Source§fn get_code_by_hash(
&mut self,
code_hash: &B256,
) -> Result<Bytecode, Self::Error>
fn get_code_by_hash( &mut self, code_hash: &B256, ) -> Result<Bytecode, Self::Error>
Loads bytecode by code hash.
Source§fn get_storage(
&mut self,
address: &Address,
index: &Word,
) -> Result<Word, Self::Error>
fn get_storage( &mut self, address: &Address, index: &Word, ) -> Result<Word, Self::Error>
Loads a persistent storage slot.
Auto Trait Implementations§
impl<'a, DB> !UnwindSafe for CachedReadsDbMut<'a, DB>
impl<'a, DB> Forget for CachedReadsDbMut<'a, DB>
impl<'a, DB> Freeze for CachedReadsDbMut<'a, DB>where
DB: Freeze,
impl<'a, DB> Move for CachedReadsDbMut<'a, DB>
impl<'a, DB> RefUnwindSafe for CachedReadsDbMut<'a, DB>where
DB: RefUnwindSafe,
impl<'a, DB> Send for CachedReadsDbMut<'a, DB>where
DB: Send,
impl<'a, DB> Sync for CachedReadsDbMut<'a, DB>where
DB: Sync,
impl<'a, DB> Unpin for CachedReadsDbMut<'a, DB>where
DB: Unpin,
impl<'a, DB> UnsafeUnpin for CachedReadsDbMut<'a, DB>where
DB: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§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> ⓘ
Converts
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> ⓘ
Converts
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: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.