//! Abstractions for fetching compact filter data from the network (HTTP or P2P).
useasync_trait::async_trait;usebitcoin::BlockHash;/// A batch of rolling compact-filter headers returned by the source.
pubstructCfHeadersBatch{/// Height of the first header in `headers`.
pubstart_height:u32,
/// Consecutive rolling cfheader hashes (each is a 32-byte array).
pubheaders:Vec<[u8;32]>,
}/// Network provider for compact-filter sync.
#[async_trait]pubtraitFilterSource: Send + Sync {/// Fetch a batch of rolling cfheaders starting at `start_h` and ending at the block `stop_hash`.
async fnget_cfheaders(&self,
start_h:u32,
stop_hash: BlockHash,
)->anyhow::Result<CfHeadersBatch>;/// Fetch the raw BIP-158 filter bytes for a given `block` hash.
async fnget_cfilter(&self, block: BlockHash)->anyhow::Result<Vec<u8>>;/// Fetch the raw consensus-encoded block bytes for `block` (used after a filter hit).
async fnget_block(&self, block: BlockHash)->anyhow::Result<Vec<u8>>;}