pub trait Store: Async + Clone {
type Error: Debug;
// Required methods
fn set(
&mut self,
path: Path,
value: Vec<u8>,
) -> Result<Option<Vec<u8>>, Self::Error>;
fn get(&self, height: Height, path: &Path) -> Option<Vec<u8>>;
fn delete(&mut self, path: &Path);
fn commit(&mut self) -> Result<Vec<u8>, Self::Error>;
fn current_height(&self) -> RawHeight;
fn get_keys(&self, key_prefix: &Path) -> Vec<Path>;
// Provided methods
fn apply(&mut self) -> Result<(), Self::Error> { ... }
fn reset(&mut self) { ... }
fn prune(&mut self, height: RawHeight) -> Result<RawHeight, Self::Error> { ... }
}Expand description
Store trait - maybe provableStore or privateStore
Required Associated Types§
Required Methods§
Sourcefn set(
&mut self,
path: Path,
value: Vec<u8>,
) -> Result<Option<Vec<u8>>, Self::Error>
fn set( &mut self, path: Path, value: Vec<u8>, ) -> Result<Option<Vec<u8>>, Self::Error>
Set value for path
Sourcefn get(&self, height: Height, path: &Path) -> Option<Vec<u8>>
fn get(&self, height: Height, path: &Path) -> Option<Vec<u8>>
Get associated value for path at specified height
Sourcefn commit(&mut self) -> Result<Vec<u8>, Self::Error>
fn commit(&mut self) -> Result<Vec<u8>, Self::Error>
Commit Pending block to canonical chain and create new Pending
Sourcefn current_height(&self) -> RawHeight
fn current_height(&self) -> RawHeight
Return the current height of the chain
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.