Skip to content

Commit 7b2cd8e

Browse files
mgoldenbergHywan
authored andcommitted
feat(indexeddb): add debug impl to serializers and event cache store
Signed-off-by: Michael Goldenberg <[email protected]>
1 parent d567a45 commit 7b2cd8e

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

crates/matrix-sdk-indexeddb/src/event_cache_store/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ pub use error::IndexeddbEventCacheStoreError;
3535
/// contexts.
3636
///
3737
/// [1]: matrix_sdk_base::event_cache::store::EventCacheStore
38+
#[derive(Debug)]
3839
pub struct IndexeddbEventCacheStore {
3940
// A handle to the IndexedDB database
4041
inner: IdbDatabase,

crates/matrix-sdk-indexeddb/src/event_cache_store/serializer/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ impl<T> From<serde_wasm_bindgen::Error> for IndexeddbEventCacheStoreSerializerEr
5252
/// [`EventCacheStore`][1].
5353
///
5454
/// [1]: matrix_sdk_base::event_cache::store::EventCacheStore
55+
#[derive(Debug)]
5556
pub struct IndexeddbEventCacheStoreSerializer {
5657
inner: IndexeddbSerializer,
5758
}

crates/matrix-sdk-indexeddb/src/serializer.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ pub struct IndexeddbSerializer {
3939
store_cipher: Option<Arc<StoreCipher>>,
4040
}
4141

42+
impl std::fmt::Debug for IndexeddbSerializer {
43+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
44+
f.debug_struct("IndexeddbSerializer")
45+
.field("store_cipher", &self.store_cipher.as_ref().map(|_| "<StoreCipher>"))
46+
.finish()
47+
}
48+
}
49+
4250
#[derive(Debug, thiserror::Error)]
4351
pub enum IndexeddbSerializerError {
4452
#[error(transparent)]

0 commit comments

Comments
 (0)