pub struct TransactionCache { /* private fields */ }Expand description
Transaction cache
Implementations§
Source§impl TransactionCache
impl TransactionCache
Sourcepub fn new(config: CacheConfig) -> Self
pub fn new(config: CacheConfig) -> Self
Create a new transaction cache
Sourcepub async fn get(&self, txid: &Txid) -> Option<GetRawTransactionResult>
pub async fn get(&self, txid: &Txid) -> Option<GetRawTransactionResult>
Get a transaction from cache
Sourcepub async fn insert(&self, txid: Txid, tx: GetRawTransactionResult)
pub async fn insert(&self, txid: Txid, tx: GetRawTransactionResult)
Insert a transaction into cache
Sourcepub async fn invalidate(&self, txid: &Txid)
pub async fn invalidate(&self, txid: &Txid)
Invalidate a specific transaction
Sourcepub async fn stats(&self) -> CacheStats
pub async fn stats(&self) -> CacheStats
Get cache statistics
Auto Trait Implementations§
impl Freeze for TransactionCache
impl !RefUnwindSafe for TransactionCache
impl Send for TransactionCache
impl Sync for TransactionCache
impl Unpin for TransactionCache
impl !UnwindSafe for TransactionCache
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