pub struct InMemoryChainStateStore { /* private fields */ }Expand description
In-memory implementation of ChainStateStore using HashMap and RwLock
Implementations§
Source§impl InMemoryChainStateStore
impl InMemoryChainStateStore
Sourcepub async fn init_with_genesis(&self, genesis_hash: BlockHash)
pub async fn init_with_genesis(&self, genesis_hash: BlockHash)
Initialize with genesis block tip
Trait Implementations§
Source§impl ChainStateStore for InMemoryChainStateStore
impl ChainStateStore for InMemoryChainStateStore
Source§fn get_utxo<'life0, 'life1, 'async_trait>(
&'life0 self,
txid: &'life1 Txid,
vout: u32,
) -> Pin<Box<dyn Future<Output = Result<Option<UtxoEntry>, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_utxo<'life0, 'life1, 'async_trait>(
&'life0 self,
txid: &'life1 Txid,
vout: u32,
) -> Pin<Box<dyn Future<Output = Result<Option<UtxoEntry>, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieves a UTXO from the UTXO set. Read more
Source§fn has_utxo<'life0, 'life1, 'async_trait>(
&'life0 self,
txid: &'life1 Txid,
vout: u32,
) -> Pin<Box<dyn Future<Output = Result<bool, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn has_utxo<'life0, 'life1, 'async_trait>(
&'life0 self,
txid: &'life1 Txid,
vout: u32,
) -> Pin<Box<dyn Future<Output = Result<bool, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Checks if a UTXO exists in the UTXO set. Read more
Source§fn write_utxo_set<'life0, 'async_trait>(
&'life0 self,
adds: Vec<(Txid, u32, UtxoEntry)>,
removes: Vec<(Txid, u32)>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn write_utxo_set<'life0, 'async_trait>(
&'life0 self,
adds: Vec<(Txid, u32, UtxoEntry)>,
removes: Vec<(Txid, u32)>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Atomically writes a batch of UTXO updates to the UTXO set. Read more
Source§fn get_best_chain_tip<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(BlockHash, u32), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_best_chain_tip<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(BlockHash, u32), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Gets the hash and height of the best chain tip. Read more
Auto Trait Implementations§
impl Freeze for InMemoryChainStateStore
impl !RefUnwindSafe for InMemoryChainStateStore
impl Send for InMemoryChainStateStore
impl Sync for InMemoryChainStateStore
impl Unpin for InMemoryChainStateStore
impl UnsafeUnpin for InMemoryChainStateStore
impl !UnwindSafe for InMemoryChainStateStore
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