pub struct MemoryDatabase { /* private fields */ }Available on crate feature
memory-database only.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 !Freeze for MemoryDatabase
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more