[][src]Struct substrate_client_db::Backend

pub struct Backend<Block: BlockT> { /* fields omitted */ }

Disk backend. Keeps data in a key-value store. In archive mode, trie nodes are kept from all blocks. Otherwise, trie nodes are kept only from some recent blocks.

Methods

impl<Block: BlockT<Hash = H256>> Backend<Block>[src]

pub fn new(
    config: DatabaseSettings,
    canonicalization_delay: u64
) -> Result<Self>
[src]

Create a new instance of database backend.

The pruning window is how old a block must be before the state is pruned.

pub fn new_test(keep_blocks: u32, canonicalization_delay: u64) -> Self[src]

Create new memory-backed client backend for tests.

pub fn new_test_db(
    keep_blocks: u32,
    canonicalization_delay: u64,
    db: Arc<dyn KeyValueDB>
) -> Self
[src]

Creates a client backend with test settings.

pub fn as_in_memory(&self) -> InMemoryBackend<Block, Blake2Hasher>[src]

Returns in-memory blockchain that contains the same set of blocks that the self.

Trait Implementations

impl<Block> AuxStore for Backend<Block> where
    Block: BlockT<Hash = H256>, 
[src]

impl<Block> Backend<Block, Blake2Hasher> for Backend<Block> where
    Block: BlockT<Hash = H256>, 
[src]

type BlockImportOperation = BlockImportOperation<Block, Blake2Hasher>

Associated block insertion operation type.

type Blockchain = BlockchainDb<Block>

Associated blockchain backend type.

type State = CachingState<Blake2Hasher, RefTrackingState<Block>, Block>

Associated state backend type.

type ChangesTrieStorage = DbChangesTrieStorage<Block>

Changes trie storage.

type OffchainStorage = LocalStorage

Offchain workers local storage.

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

Insert auxiliary data into key-value store.

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

Query auxiliary data from key-value store.

impl<Block> LocalBackend<Block, Blake2Hasher> for Backend<Block> where
    Block: BlockT<Hash = H256>, 
[src]

Auto Trait Implementations

impl<Block> Unpin for Backend<Block> where
    Block: Unpin,
    <Block as Block>::Hash: Unpin,
    <Block as Block>::Header: Header,
    <<Block as Block>::Header as Header>::Number: Unpin

impl<Block> Send for Backend<Block> where
    <Block as Block>::Hash: Send + Sync,
    <Block as Block>::Header: Header,
    <<Block as Block>::Header as Header>::Number: Send + Sync

impl<Block> Sync for Backend<Block> where
    <Block as Block>::Hash: Send + Sync,
    <Block as Block>::Header: Header,
    <<Block as Block>::Header as Header>::Number: Send + Sync

impl<Block> !UnwindSafe for Backend<Block>

impl<Block> !RefUnwindSafe for Backend<Block>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> CheckedConversion for T[src]

fn checked_from<T>(t: T) -> Option<Self> where
    Self: TryFrom<T>, 
[src]

Convert from a value of T into an equivalent instance of Option<Self>. Read more

fn checked_into<T>(self) -> Option<T> where
    Self: TryInto<T>, 
[src]

Consume self to return Some equivalent value of Option<T>. Read more

impl<S, T> UncheckedInto<T> for S where
    T: UncheckedFrom<S>, 
[src]

impl<T, Outer> IsWrappedBy<Outer> for T where
    Outer: AsRef<T> + AsMut<T> + From<T>,
    T: From<Outer>, 
[src]

fn from_ref(outer: &Outer) -> &T[src]

Get a reference to the inner from the outer.

fn from_mut(outer: &mut Outer) -> &mut T[src]

Get a mutable reference to the inner from the outer.

impl<T> SaturatedConversion for T[src]

fn saturated_from<T>(t: T) -> Self where
    Self: UniqueSaturatedFrom<T>, 
[src]

Convert from a value of T into an equivalent instance of Self. Read more

fn saturated_into<T>(self) -> T where
    Self: UniqueSaturatedInto<T>, 
[src]

Consume self to return an equivalent value of T. Read more

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> Erased for T[src]

impl<T, S> UniqueSaturatedInto<T> for S where
    S: TryInto<T>,
    T: Bounded
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]

impl<T> Erased for T[src]