Struct bdk::database::memory::MemoryDatabase [−][src]
pub struct MemoryDatabase { /* fields omitted */ }
Expand description
In-memory ephemeral database
This database can be used as a temporary storage for wallets that are not kept permanently on
a device, or on platforms that don’t provide a filesystem, like wasm32
.
Once it’s dropped its content will be lost.
If you are looking for a permanent storage solution, you can try with the default key-value
database called sled
. See the database
module documentation for more defailts.
Implementations
Trait Implementations
type Batch = Self
type Batch = Self
Container for the operations
Create a new batch container
fn set_script_pubkey(
&mut self,
script: &Script,
keychain: KeychainKind,
path: u32
) -> Result<(), Error>
fn set_script_pubkey(
&mut self,
script: &Script,
keychain: KeychainKind,
path: u32
) -> Result<(), Error>
Store a script_pubkey along with its keychain and child number.
Store a raw transaction
Store the metadata of a transaction
Store the last derivation index for a given keychain.
fn del_script_pubkey_from_path(
&mut self,
keychain: KeychainKind,
path: u32
) -> Result<Option<Script>, Error>
fn del_script_pubkey_from_path(
&mut self,
keychain: KeychainKind,
path: u32
) -> Result<Option<Script>, Error>
Delete a script_pubkey given the keychain and its child number.
fn del_path_from_script_pubkey(
&mut self,
script: &Script
) -> Result<Option<(KeychainKind, u32)>, Error>
fn del_path_from_script_pubkey(
&mut self,
script: &Script
) -> Result<Option<(KeychainKind, u32)>, Error>
Delete the data related to a specific script_pubkey, meaning the keychain and the child number. Read more
Delete a raw transaction given its Txid
Delete the metadata of a transaction and optionally the raw transaction itself
Delete the last derivation index for a keychain.
fn check_descriptor_checksum<B: AsRef<[u8]>>(
&mut self,
keychain: KeychainKind,
bytes: B
) -> Result<(), Error>
fn check_descriptor_checksum<B: AsRef<[u8]>>(
&mut self,
keychain: KeychainKind,
bytes: B
) -> Result<(), Error>
Read and checks the descriptor checksum for a given keychain. Read more
Return the list of script_pubkeys
Return the list of raw transactions
Return the list of transactions metadata
fn get_script_pubkey_from_path(
&self,
keychain: KeychainKind,
path: u32
) -> Result<Option<Script>, Error>
fn get_script_pubkey_from_path(
&self,
keychain: KeychainKind,
path: u32
) -> Result<Option<Script>, Error>
Fetch a script_pubkey given the child number of a keychain.
fn get_path_from_script_pubkey(
&self,
script: &Script
) -> Result<Option<(KeychainKind, u32)>, Error>
fn get_path_from_script_pubkey(
&self,
script: &Script
) -> Result<Option<(KeychainKind, u32)>, Error>
Fetch the keychain and child number of a given script_pubkey
Fetch a raw transaction given its Txid
Fetch the transaction metadata and optionally also the raw transaction
Return the last defivation index for a keychain.
Increment the last derivation index for a keychain and return it Read more
Returns the “default value” for a type. Read more
Performs the conversion.
Performs the conversion.
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
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
pub fn vzip(self) -> V