diff --git a/crates/matrix-sdk-indexeddb/src/event_cache_store/serializer/traits.rs b/crates/matrix-sdk-indexeddb/src/event_cache_store/serializer/traits.rs index 16e471932..b5e59bc71 100644 --- a/crates/matrix-sdk-indexeddb/src/event_cache_store/serializer/traits.rs +++ b/crates/matrix-sdk-indexeddb/src/event_cache_store/serializer/traits.rs @@ -24,6 +24,9 @@ use crate::serializer::IndexeddbSerializer; /// decryption, in the case the high-level type must be encrypted before /// storage. pub trait Indexed: Sized { + /// The name of the object store in IndexedDB. + const OBJECT_STORE: &'static str; + /// The indexed type that is used for storage in IndexedDB. type IndexedType; /// The error type that is returned when conversion fails. diff --git a/crates/matrix-sdk-indexeddb/src/event_cache_store/serializer/types.rs b/crates/matrix-sdk-indexeddb/src/event_cache_store/serializer/types.rs index 8193b216f..8a6be6d57 100644 --- a/crates/matrix-sdk-indexeddb/src/event_cache_store/serializer/types.rs +++ b/crates/matrix-sdk-indexeddb/src/event_cache_store/serializer/types.rs @@ -144,6 +144,8 @@ pub struct IndexedChunk { } impl Indexed for Chunk { + const OBJECT_STORE: &'static str = keys::LINKED_CHUNKS; + type IndexedType = IndexedChunk; type Error = CryptoStoreError; @@ -300,6 +302,8 @@ pub enum IndexedEventError { } impl Indexed for Event { + const OBJECT_STORE: &'static str = keys::EVENTS; + type IndexedType = IndexedEvent; type Error = IndexedEventError; @@ -460,6 +464,8 @@ pub struct IndexedGap { } impl Indexed for Gap { + const OBJECT_STORE: &'static str = keys::GAPS; + type IndexedType = IndexedGap; type Error = CryptoStoreError;