sc_client_api::backend

Trait AuxStore

Source
pub trait AuxStore {
    // Required methods
    fn insert_aux<'a, 'b: 'a, 'c: 'a, I: IntoIterator<Item = &'a (&'c [u8], &'c [u8])>, D: IntoIterator<Item = &'a &'b [u8]>>(
        &self,
        insert: I,
        delete: D,
    ) -> Result<()>;
    fn get_aux(&self, key: &[u8]) -> Result<Option<Vec<u8>>>;
}
Expand description

Provides access to an auxiliary database.

This is a simple global database not aware of forks. Can be used for storing auxiliary information like total block weight/difficulty for fork resolution purposes as a common use case.

Required Methods§

Source

fn insert_aux<'a, 'b: 'a, 'c: 'a, I: IntoIterator<Item = &'a (&'c [u8], &'c [u8])>, D: IntoIterator<Item = &'a &'b [u8]>>( &self, insert: I, delete: D, ) -> Result<()>

Insert auxiliary data into key-value store.

Deletions occur after insertions.

Source

fn get_aux(&self, key: &[u8]) -> Result<Option<Vec<u8>>>

Query auxiliary data from key-value store.

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.

Implementors§

Source§

impl<Block: BlockT> AuxStore for Backend<Block>

Source§

impl<Block: BlockT> AuxStore for Blockchain<Block>