pub trait IpfsBlockProvider: Send + Sync {
// Required methods
fn have(&self, multihash: &Multihash<32>) -> bool;
fn get(&self, multihash: &Multihash<32>) -> Option<Vec<u8>>;
fn changes(&self) -> Pin<Box<dyn Stream<Item = Change> + Send>>;
}Expand description
Provides blocks to be served over IPFS. Requires Send and Sync so we can write Arc<dyn BlockProvider> instead of Arc<dyn BlockProvider + Send + Sync>.
Required Methods§
Sourcefn have(&self, multihash: &Multihash<32>) -> bool
fn have(&self, multihash: &Multihash<32>) -> bool
Returns true if we have the block with the given hash.