TransactableStorage

Trait TransactableStorage 

Source
pub trait TransactableStorage<Height>:
    IterableStore
    + Debug
    + Send
    + Sync {
    // Required methods
    fn commit_changes(
        &self,
        height: Option<Height>,
        changes: StorageChanges,
    ) -> StorageResult<()>;
    fn view_at_height(
        &self,
        height: &Height,
    ) -> StorageResult<KeyValueView<Self::Column, Height>>;
    fn latest_view(
        &self,
    ) -> StorageResult<IterableKeyValueView<Self::Column, Height>>;
    fn rollback_block_to(&self, height: &Height) -> StorageResult<()>;

    // Provided method
    fn shutdown(&self) { ... }
}

Required Methods§

Source

fn commit_changes( &self, height: Option<Height>, changes: StorageChanges, ) -> StorageResult<()>

Commits the changes into the storage.

Source

fn view_at_height( &self, height: &Height, ) -> StorageResult<KeyValueView<Self::Column, Height>>

Source

fn latest_view( &self, ) -> StorageResult<IterableKeyValueView<Self::Column, Height>>

Source

fn rollback_block_to(&self, height: &Height) -> StorageResult<()>

Provided Methods§

Source

fn shutdown(&self)

Implementors§

Source§

impl<Description> TransactableStorage<<Description as DatabaseDescription>::Height> for HistoricalRocksDB<Description>
where Description: DatabaseDescription,

Source§

impl<Description> TransactableStorage<<Description as DatabaseDescription>::Height> for MemoryStore<Description>
where Description: DatabaseDescription,