diff --git a/crates/matrix-sdk-crypto/src/store/mod.rs b/crates/matrix-sdk-crypto/src/store/mod.rs
index 9967f8709..eed2662e9 100644
--- a/crates/matrix-sdk-crypto/src/store/mod.rs
+++ b/crates/matrix-sdk-crypto/src/store/mod.rs
@@ -38,14 +38,6 @@
//! [`OlmMachine`]: /matrix_sdk_crypto/struct.OlmMachine.html
//! [`CryptoStore`]: trait.Cryptostore.html
-pub mod caches;
-mod memorystore;
-
-#[cfg(any(test, feature = "testing"))]
-#[macro_use]
-#[allow(missing_docs)]
-pub mod integration_tests;
-
use std::{
collections::{HashMap, HashSet},
fmt::Debug,
@@ -54,14 +46,11 @@ use std::{
sync::{atomic::AtomicBool, Arc},
};
-use async_trait::async_trait;
use atomic::Ordering;
use dashmap::DashSet;
-use matrix_sdk_common::{locks::Mutex, AsyncTraitDeps};
-pub use memorystore::MemoryStore;
+use matrix_sdk_common::locks::Mutex;
use ruma::{
- events::secret::request::SecretName, DeviceId, IdParseError, OwnedDeviceId, OwnedUserId,
- RoomId, TransactionId, UserId,
+ events::secret::request::SecretName, DeviceId, IdParseError, OwnedDeviceId, OwnedUserId, UserId,
};
use serde::{Deserialize, Serialize};
use serde_json::Error as SerdeError;
@@ -70,6 +59,18 @@ use tracing::{info, warn};
use vodozemac::{megolm::SessionOrdering, Curve25519PublicKey};
use zeroize::Zeroize;
+pub mod caches;
+mod memorystore;
+mod traits;
+
+#[cfg(any(test, feature = "testing"))]
+#[macro_use]
+#[allow(missing_docs)]
+pub mod integration_tests;
+
+pub use memorystore::MemoryStore;
+pub use traits::{CryptoStore, IntoCryptoStore};
+
use crate::{
identities::{
user::{OwnUserIdentity, UserIdentities, UserIdentity},
@@ -786,179 +787,3 @@ impl CryptoStoreError {
Self::Backend(Box::new(error))
}
}
-
-/// Represents a store that the `OlmMachine` uses to store E2EE data (such as
-/// cryptographic keys).
-#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
-#[cfg_attr(not(target_arch = "wasm32"), async_trait)]
-pub trait CryptoStore: AsyncTraitDeps {
- /// Load an account that was previously stored.
- async fn load_account(&self) -> Result