Trait nakamoto_chain::filter::store::Filters
source · pub trait Filters {
fn get_headers(
&self,
range: RangeInclusive<u64>
) -> Vec<(FilterHash, FilterHeader), Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
;
fn get_header(&self, height: u64) -> Option<(FilterHash, FilterHeader)>;
fn import_headers(
&mut self,
headers: Vec<(FilterHash, FilterHeader), Global>
) -> Result<u64, Error>;
fn tip(&self) -> (&FilterHash, &FilterHeader);
fn height(&self) -> u64;
fn rollback(&mut self, height: u64) -> Result<(), Error>;
fn clear(&mut self) -> Result<(), Error>;
fn get_prev_header(&self, height: u64) -> Option<FilterHeader> { ... }
}
Expand description
A trait for types that provide read/write access to compact block filters, and filter headers.
Required Methods
sourcefn get_headers(
&self,
range: RangeInclusive<u64>
) -> Vec<(FilterHash, FilterHeader), Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
fn get_headers(
&self,
range: RangeInclusive<u64>
) -> Vec<(FilterHash, FilterHeader), Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
Get filter headers given a block height range.
sourcefn get_header(&self, height: u64) -> Option<(FilterHash, FilterHeader)>
fn get_header(&self, height: u64) -> Option<(FilterHash, FilterHeader)>
Get the filter header at the given height. Includes the hash of the filter itself.
sourcefn import_headers(
&mut self,
headers: Vec<(FilterHash, FilterHeader), Global>
) -> Result<u64, Error>
fn import_headers(
&mut self,
headers: Vec<(FilterHash, FilterHeader), Global>
) -> Result<u64, Error>
Import filter headers.
sourcefn tip(&self) -> (&FilterHash, &FilterHeader)
fn tip(&self) -> (&FilterHash, &FilterHeader)
Get the tip of the filter header chain.
Provided Methods
sourcefn get_prev_header(&self, height: u64) -> Option<FilterHeader>
fn get_prev_header(&self, height: u64) -> Option<FilterHeader>
Get the filter header previous to the given height.