}
}
#[derive(Serialize)]
pub(crate) struct Info {
blocks_indexed: u32,
branch_pages: u64,
fragmented_bytes: u64,
index_file_size: u64,
index_path: PathBuf,
leaf_pages: u64,
metadata_bytes: u64,
outputs_traversed: u64,
page_size: usize,
sat_ranges: u64,
stored_bytes: u64,
tables: BTreeMap<String, TableInfo>,
pub(crate) transactions: Vec<TransactionInfo>,
tree_height: u32,
utxos_indexed: u64,
}
#[derive(Serialize)]
pub(crate) struct TableInfo {
branch_pages: u64,
fragmented_bytes: u64,
leaf_pages: u64,
metadata_bytes: u64,
stored_bytes: u64,
tree_height: u32,
}
#[derive(Serialize)]
pub(crate) struct TransactionInfo {
pub(crate) starting_block_count: u32,
pub(crate) starting_timestamp: u128,
}
trait BitcoinCoreRpcResultExt<T> {
fn into_option(self) -> Result<Option<T>>;
}
impl<T> BitcoinCoreRpcResultExt<T> for Result<T, bitcoincore_rpc::Error> {
fn into_option(self) -> Result<Option<T>> {
match self {
Ok(ok) => Ok(Some(ok)),
Err(bitcoincore_rpc::Error::JsonRpc(bitcoincore_rpc::jsonrpc::error::Error::Rpc(