Struct floresta_watch_only::kv_database::KvDatabase
source · pub struct KvDatabase(/* private fields */);
Implementations§
source§impl KvDatabase
impl KvDatabase
pub fn new(datadir: String) -> Result<KvDatabase, KvDatabaseError>
Trait Implementations§
source§impl AddressCacheDatabase for KvDatabase
impl AddressCacheDatabase for KvDatabase
type Error = KvDatabaseError
source§fn load(&self) -> Result<Vec<CachedAddress>, KvDatabaseError>
fn load(&self) -> Result<Vec<CachedAddress>, KvDatabaseError>
Loads all addresses we have cached so far
source§fn save(&self, address: &CachedAddress)
fn save(&self, address: &CachedAddress)
Saves a new address to the database. If the address already exists,
update
should
be used insteadsource§fn update(&self, address: &CachedAddress)
fn update(&self, address: &CachedAddress)
Updates an address, probably because a new transaction arrived
source§fn get_cache_height(&self) -> Result<u32, KvDatabaseError>
fn get_cache_height(&self) -> Result<u32, KvDatabaseError>
TODO: Maybe turn this into another db
Returns the height of the last block we filtered
source§fn set_cache_height(&self, height: u32) -> Result<(), KvDatabaseError>
fn set_cache_height(&self, height: u32) -> Result<(), KvDatabaseError>
Saves the height of the last block we filtered
source§fn desc_save(&self, descriptor: &str) -> Result<(), KvDatabaseError>
fn desc_save(&self, descriptor: &str) -> Result<(), KvDatabaseError>
Saves the descriptor of associated cache
source§fn get_transaction(
&self,
txid: &Txid
) -> Result<CachedTransaction, KvDatabaseError>
fn get_transaction( &self, txid: &Txid ) -> Result<CachedTransaction, KvDatabaseError>
Get a transaction from the database
source§fn save_transaction(
&self,
tx: &CachedTransaction
) -> Result<(), KvDatabaseError>
fn save_transaction( &self, tx: &CachedTransaction ) -> Result<(), KvDatabaseError>
Saves a transaction to the database
source§fn get_stats(&self) -> Result<Stats, KvDatabaseError>
fn get_stats(&self) -> Result<Stats, KvDatabaseError>
Loads the data associated with our watch-only wallet.
source§fn save_stats(&self, stats: &Stats) -> Result<(), KvDatabaseError>
fn save_stats(&self, stats: &Stats) -> Result<(), KvDatabaseError>
Saves the data associated with our watch-only wallet.
source§fn list_transactions(&self) -> Result<Vec<Txid>, KvDatabaseError>
fn list_transactions(&self) -> Result<Vec<Txid>, KvDatabaseError>
Returns all transaction we have cached so far
Auto Trait Implementations§
impl !RefUnwindSafe for KvDatabase
impl Send for KvDatabase
impl Sync for KvDatabase
impl Unpin for KvDatabase
impl !UnwindSafe for KvDatabase
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