Struct sapio_base::txindex::CachedTxIndex
source · pub struct CachedTxIndex<Cache: TxIndex, Primary: TxIndex> {
pub cache: Cache,
pub primary: Primary,
}
Expand description
a cached txindex checks a cache first and then a primary txindex
Fields§
§cache: Cache
the cache txindex
primary: Primary
the main txindex
Trait Implementations§
source§impl<Cache, Primary> TxIndex for CachedTxIndex<Cache, Primary>
impl<Cache, Primary> TxIndex for CachedTxIndex<Cache, Primary>
source§fn lookup_tx(&self, b: &Txid) -> Result<Arc<Transaction>, TxIndexError>
fn lookup_tx(&self, b: &Txid) -> Result<Arc<Transaction>, TxIndexError>
lookup a tx
source§fn add_tx(&self, tx: Arc<Transaction>) -> Result<Txid, TxIndexError>
fn add_tx(&self, tx: Arc<Transaction>) -> Result<Txid, TxIndexError>
locally add a tx for tracking
source§fn lookup_output(&self, b: &OutPoint) -> Result<TxOut, TxIndexError>
fn lookup_output(&self, b: &OutPoint) -> Result<TxOut, TxIndexError>
lookup a particular output
Auto Trait Implementations§
impl<Cache, Primary> RefUnwindSafe for CachedTxIndex<Cache, Primary>where
Cache: RefUnwindSafe,
Primary: RefUnwindSafe,
impl<Cache, Primary> Send for CachedTxIndex<Cache, Primary>
impl<Cache, Primary> Sync for CachedTxIndex<Cache, Primary>
impl<Cache, Primary> Unpin for CachedTxIndex<Cache, Primary>
impl<Cache, Primary> UnwindSafe for CachedTxIndex<Cache, Primary>where
Cache: UnwindSafe,
Primary: UnwindSafe,
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