Struct sc_client_db::Backend [−][src]
pub struct Backend<Block: BlockT> { /* fields omitted */ }
Expand description
Disk backend.
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.
Implementations
Create a new instance of database backend.
The pruning window is how old a block must be before the state is pruned.
Create new memory-backed client backend for tests.
pub fn new_test_with_tx_storage(
keep_blocks: u32,
canonicalization_delay: u64,
transaction_storage: TransactionStorageMode
) -> Self
pub fn new_test_with_tx_storage(
keep_blocks: u32,
canonicalization_delay: u64,
transaction_storage: TransactionStorageMode
) -> Self
Create new memory-backed client backend for tests.
Trait Implementations
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
) -> ClientResult<()>
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
) -> ClientResult<()>
Insert auxiliary data into key-value store. Read more
type BlockImportOperation = BlockImportOperation<Block>
type BlockImportOperation = BlockImportOperation<Block>
Associated block insertion operation type.
type Blockchain = BlockchainDb<Block>
type Blockchain = BlockchainDb<Block>
Associated blockchain backend type.
type State = SyncingCachingState<RefTrackingState<Block>, Block>
type State = SyncingCachingState<RefTrackingState<Block>, Block>
Associated state backend type.
type OffchainStorage = LocalStorage
type OffchainStorage = LocalStorage
Offchain workers local storage.
Begin a new block insertion transaction with given parent block id. Read more
fn begin_state_operation(
&self,
operation: &mut Self::BlockImportOperation,
block: BlockId<Block>
) -> ClientResult<()>
fn begin_state_operation(
&self,
operation: &mut Self::BlockImportOperation,
block: BlockId<Block>
) -> ClientResult<()>
Note an operation to contain state transition.
Commit block insertion.
fn finalize_block(
&self,
block: BlockId<Block>,
justification: Option<Justification>
) -> ClientResult<()>
fn finalize_block(
&self,
block: BlockId<Block>,
justification: Option<Justification>
) -> ClientResult<()>
Finalize block with given Id. Read more
fn append_justification(
&self,
block: BlockId<Block>,
justification: Justification
) -> ClientResult<()>
fn append_justification(
&self,
block: BlockId<Block>,
justification: Justification
) -> ClientResult<()>
Append justification to the block with the given Id. Read more
Returns reference to changes trie storage.
Returns a handle to offchain storage.
Returns current usage statistics.
Attempts to revert the chain by n
blocks. If revert_finalized
is set it will attempt to
revert past any finalized block, this is unsafe and can potentially leave the node in an
inconsistent state. Read more
Discard non-best, unfinalized leaf block.
Returns reference to blockchain backend.
Returns state backend with post-state of given block.
Returns true if state for given block is available.
Gain access to the import lock around this backend. Read more
Insert auxiliary data into key-value store.
Auto Trait Implementations
impl<Block> !RefUnwindSafe for Backend<Block>
impl<Block> Unpin for Backend<Block> where
<Block as Block>::Hash: Unpin,
<<Block as Block>::Header as Header>::Number: Unpin,
impl<Block> !UnwindSafe for Backend<Block>
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
The counterpart to unchecked_from
.
Consume self to return an equivalent value of T
.
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more