From e2572477c687076b09a2662d233f067f6e7bbccc Mon Sep 17 00:00:00 2001 From: Ron Kuris Date: Tue, 15 Aug 2023 12:24:26 -0700 Subject: [PATCH] Add #[derive(Debug)] in a few missing places (#193) --- firewood/src/db.rs | 8 ++++++-- firewood/src/merkle.rs | 1 + shale/src/compact.rs | 3 +++ shale/src/lib.rs | 6 ++++-- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/firewood/src/db.rs b/firewood/src/db.rs index 2569d3d2c..c1a9d1cb8 100644 --- a/firewood/src/db.rs +++ b/firewood/src/db.rs @@ -102,7 +102,7 @@ struct DbParams { root_hash_file_nbit: u64, } -#[derive(Clone)] +#[derive(Clone, Debug)] /// Necessary linear space instances bundled for a `CompactSpace`. struct SubUniverse { meta: T, @@ -221,7 +221,7 @@ impl Storable for DbHeader { } } -#[derive(Clone)] +#[derive(Clone, Debug)] /// Necessary linear space instances bundled for the state of the entire DB. struct Universe { merkle: SubUniverse, @@ -273,6 +273,7 @@ impl Universe> { } /// Some readable version of the DB. +#[derive(Debug)] pub struct DbRev { header: shale::Obj, merkle: Merkle, @@ -341,6 +342,7 @@ impl + Send + Sync> DbRev { } } +#[derive(Debug)] struct DbInner { disk_requester: DiskBufferRequester, disk_thread: Option>, @@ -357,6 +359,7 @@ impl Drop for DbInner { } } +#[derive(Debug)] pub struct DbRevInner { inner: VecDeque>, root_hashes: VecDeque, @@ -366,6 +369,7 @@ pub struct DbRevInner { } /// Firewood database handle. +#[derive(Debug)] pub struct Db { inner: Arc>, revisions: Arc>>, diff --git a/firewood/src/merkle.rs b/firewood/src/merkle.rs index a4673aab3..09d1338ff 100644 --- a/firewood/src/merkle.rs +++ b/firewood/src/merkle.rs @@ -842,6 +842,7 @@ macro_rules! write_node { }; } +#[derive(Debug)] pub struct Merkle { store: Box, } diff --git a/shale/src/compact.rs b/shale/src/compact.rs index f37a3f871..408cb3e08 100644 --- a/shale/src/compact.rs +++ b/shale/src/compact.rs @@ -133,6 +133,7 @@ pub struct CompactSpaceHeader { alloc_addr: ObjPtr, } +#[derive(Debug)] struct CompactSpaceHeaderSliced { meta_space_tail: Obj, compact_space_tail: Obj, @@ -293,6 +294,7 @@ impl std::ops::DerefMut for U64Field { } } +#[derive(Debug)] struct CompactSpaceInner { meta_space: Arc, compact_space: Arc, @@ -562,6 +564,7 @@ impl CompactSpaceInner { } } +#[derive(Debug)] pub struct CompactSpace { inner: RwLock>, } diff --git a/shale/src/lib.rs b/shale/src/lib.rs index 524ea269a..adb8c081a 100644 --- a/shale/src/lib.rs +++ b/shale/src/lib.rs @@ -516,14 +516,16 @@ impl Storable for ObjPtr { } } -pub struct ObjCacheInner { +#[derive(Debug)] +pub struct ObjCacheInner { cached: lru::LruCache, Obj>, pinned: HashMap, bool>, dirty: HashSet>, } /// [ObjRef] pool that is used by [ShaleStore] implementation to construct [ObjRef]s. -pub struct ObjCache(Arc>>); +#[derive(Debug)] +pub struct ObjCache(Arc>>); impl ObjCache { pub fn new(capacity: usize) -> Self {