mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-20 15:38:11 -07:00
17 lines
577 B
Rust
17 lines
577 B
Rust
use brk_error::Result;
|
|
use brk_types::{Height, Version};
|
|
use fjall::Keyspace;
|
|
|
|
pub trait AnyStore: Send + Sync {
|
|
fn name(&self) -> &'static str;
|
|
fn height(&self) -> Option<Height>;
|
|
fn has(&self, height: Height) -> bool;
|
|
fn needs(&self, height: Height) -> bool;
|
|
fn version(&self) -> Version;
|
|
fn export_meta(&mut self, height: Height) -> Result<()>;
|
|
fn export_meta_if_needed(&mut self, height: Height) -> Result<()>;
|
|
fn keyspace(&self) -> &Keyspace;
|
|
fn commit(&mut self, height: Height) -> Result<()>;
|
|
fn reset(&mut self) -> Result<()>;
|
|
}
|