referrerpolicy=no-referrer-when-downgrade

AuxStore

Trait AuxStore 

pub trait AuxStore {
    // Required methods
    fn insert_aux<'a, 'b, 'c, I, D>(
        &self,
        insert: I,
        delete: D,
    ) -> Result<(), Error>
       where 'b: 'a,
             'c: 'a,
             I: IntoIterator<Item = &'a (&'c [u8], &'c [u8])>,
             D: IntoIterator<Item = &'a &'b [u8]>;
    fn get_aux(&self, key: &[u8]) -> Result<Option<Vec<u8>>, Error>;
}
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§

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

Insert auxiliary data into key-value store.

Deletions occur after insertions.

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

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.

Implementations on Foreign Types§

§

impl<B, E, Block, RA> AuxStore for &Client<B, E, Block, RA>
where B: Backend<Block>, E: CallExecutor<Block>, Block: Block, Client<B, E, Block, RA>: ProvideRuntimeApi<Block>, <Client<B, E, Block, RA> as ProvideRuntimeApi<Block>>::Api: Core<Block>,

§

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

§

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

§

impl<B, E, Block, RA> AuxStore for Client<B, E, Block, RA>
where B: Backend<Block>, E: CallExecutor<Block>, Block: Block, Client<B, E, Block, RA>: ProvideRuntimeApi<Block>, <Client<B, E, Block, RA> as ProvideRuntimeApi<Block>>::Api: Core<Block>,

§

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

Insert auxiliary data into key-value store.

§

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

Query auxiliary data from key-value store.

§

impl<Block> AuxStore for Backend<Block>
where Block: Block,

§

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

§

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

§

impl<Client> AuxStore for DefaultSubsystemClient<Client>
where Client: AuxStore,

§

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

§

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

Implementors§

§

impl<Block> AuxStore for Backend<Block>
where Block: Block,

§

impl<Block> AuxStore for Blockchain<Block>
where Block: Block,