Struct floresta_chain::pruned_utreexo::chainstore::KvChainStore
source · pub struct KvChainStore<'a> { /* private fields */ }
Implementations§
source§impl<'a> KvChainStore<'a>
impl<'a> KvChainStore<'a>
Trait Implementations§
source§impl<'a> ChainStore for KvChainStore<'a>
impl<'a> ChainStore for KvChainStore<'a>
type Error = Error
source§fn load_roots(&self) -> Result<Option<Vec<u8>>, Self::Error>
fn load_roots(&self) -> Result<Option<Vec<u8>>, Self::Error>
Loads the state of our accumulator.
source§fn save_roots(&self, roots: Vec<u8>) -> Result<(), Self::Error>
fn save_roots(&self, roots: Vec<u8>) -> Result<(), Self::Error>
Saves the current state of our accumulator.
source§fn save_height(&self, height: &BestChain) -> Result<(), Self::Error>
fn save_height(&self, height: &BestChain) -> Result<(), Self::Error>
Saves the blockchain height.
source§fn get_header(
&self,
block_hash: &BlockHash
) -> Result<Option<DiskBlockHeader>, Self::Error>
fn get_header( &self, block_hash: &BlockHash ) -> Result<Option<DiskBlockHeader>, Self::Error>
Get a block header from our database. See DiskBlockHeader for more info about
the data we save.
source§fn flush(&self) -> Result<(), Self::Error>
fn flush(&self) -> Result<(), Self::Error>
Flushes write buffers to disk, this is called periodically by the [ChainState],
so in case of a crash, we don’t lose too much data. If the database doesn’t support
write buffers, this method can be a no-op.
source§fn save_header(&self, header: &DiskBlockHeader) -> Result<(), Self::Error>
fn save_header(&self, header: &DiskBlockHeader) -> Result<(), Self::Error>
Saves a block header to our database. See DiskBlockHeader for more info about
the data we save.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for KvChainStore<'a>
impl<'a> Send for KvChainStore<'a>
impl<'a> Sync for KvChainStore<'a>
impl<'a> Unpin for KvChainStore<'a>
impl<'a> !UnwindSafe for KvChainStore<'a>
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