pub struct MemoryDatabase { /* private fields */ }
Implementations§
source§impl MemoryDatabase
impl MemoryDatabase
pub fn new() -> MemoryDatabase
Trait Implementations§
source§impl AddressCacheDatabase for MemoryDatabase
impl AddressCacheDatabase for MemoryDatabase
type Error = MemoryDatabaseError
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 load(&self) -> Result<Vec<CachedAddress>, MemoryDatabaseError>
fn load(&self) -> Result<Vec<CachedAddress>, MemoryDatabaseError>
Loads all addresses we have cached so far
source§fn get_stats(&self) -> Result<Stats, MemoryDatabaseError>
fn get_stats(&self) -> Result<Stats, MemoryDatabaseError>
Loads the data associated with our watch-only wallet.
source§fn save_stats(&self, stats: &Stats) -> Result<(), MemoryDatabaseError>
fn save_stats(&self, stats: &Stats) -> Result<(), MemoryDatabaseError>
Saves the data associated with our watch-only wallet.
source§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, MemoryDatabaseError>
fn get_cache_height(&self) -> Result<u32, MemoryDatabaseError>
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<(), MemoryDatabaseError>
fn set_cache_height(&self, height: u32) -> Result<(), MemoryDatabaseError>
Saves the height of the last block we filtered
source§fn desc_save(&self, descriptor: &str) -> Result<(), MemoryDatabaseError>
fn desc_save(&self, descriptor: &str) -> Result<(), MemoryDatabaseError>
Saves the descriptor of associated cache
source§fn get_transaction(
&self,
txid: &Txid
) -> Result<CachedTransaction, MemoryDatabaseError>
fn get_transaction( &self, txid: &Txid ) -> Result<CachedTransaction, MemoryDatabaseError>
Get a transaction from the database
source§fn save_transaction(
&self,
tx: &CachedTransaction
) -> Result<(), MemoryDatabaseError>
fn save_transaction( &self, tx: &CachedTransaction ) -> Result<(), MemoryDatabaseError>
Saves a transaction to the database
source§fn list_transactions(&self) -> Result<Vec<Txid>, MemoryDatabaseError>
fn list_transactions(&self) -> Result<Vec<Txid>, MemoryDatabaseError>
Returns all transaction we have cached so far
source§impl Debug for MemoryDatabase
impl Debug for MemoryDatabase
source§impl Default for MemoryDatabase
impl Default for MemoryDatabase
source§fn default() -> MemoryDatabase
fn default() -> MemoryDatabase
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for MemoryDatabase
impl Send for MemoryDatabase
impl Sync for MemoryDatabase
impl Unpin for MemoryDatabase
impl UnwindSafe for MemoryDatabase
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