Storage tracing (#3614)

* Storage tracing

* Whitepsaces

Co-Authored-By: Sergei Pepyakin <sergei@parity.io>

* Apply suggestions from code review

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

* Update Cargo.lock
This commit is contained in:
Arkadiy Paronyan
2019-09-17 20:42:15 +02:00
committed by GitHub
parent 2b040fe983
commit a07e567fe1
12 changed files with 223 additions and 41 deletions
+7 -1
View File
@@ -30,7 +30,7 @@ use trie::{
/// to it.
///
/// The clone operation (if implemented) should be cheap.
pub trait Backend<H: Hasher> {
pub trait Backend<H: Hasher>: std::fmt::Debug {
/// An error type when fetching data is not possible.
type Error: super::Error;
@@ -254,6 +254,12 @@ pub struct InMemory<H: Hasher> {
_hasher: PhantomData<H>,
}
impl<H: Hasher> std::fmt::Debug for InMemory<H> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "InMemory ({} values)", self.inner.len())
}
}
impl<H: Hasher> Default for InMemory<H> {
fn default() -> Self {
InMemory {