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 Freeze for KvDatabase
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
§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