From 0f60dfcfc580b0bd467300bc1f90b142b5eb5b4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Wed, 9 Mar 2022 14:40:11 +0100 Subject: [PATCH] sdk: Re-export stores and store config --- crates/matrix-sdk/src/config/client.rs | 7 +++++-- crates/matrix-sdk/src/config/mod.rs | 1 + crates/matrix-sdk/src/lib.rs | 1 + crates/matrix-sdk/src/store.rs | 22 ++++++++++++++++++++++ 4 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 crates/matrix-sdk/src/store.rs diff --git a/crates/matrix-sdk/src/config/client.rs b/crates/matrix-sdk/src/config/client.rs index ba261f729..66f920e79 100644 --- a/crates/matrix-sdk/src/config/client.rs +++ b/crates/matrix-sdk/src/config/client.rs @@ -20,9 +20,12 @@ use std::{ }; use http::header::InvalidHeaderValue; -use matrix_sdk_base::{store::StoreConfig, BaseClientConfig, StateStore}; +use matrix_sdk_base::{BaseClientConfig, StateStore}; -use crate::{config::RequestConfig, HttpSend, Result}; +use crate::{ + config::{RequestConfig, StoreConfig}, + HttpSend, Result, +}; /// Configuration for the creation of the `Client`. /// diff --git a/crates/matrix-sdk/src/config/mod.rs b/crates/matrix-sdk/src/config/mod.rs index 48830e78f..6f759d643 100644 --- a/crates/matrix-sdk/src/config/mod.rs +++ b/crates/matrix-sdk/src/config/mod.rs @@ -21,5 +21,6 @@ mod request; mod sync; pub use client::ClientConfig; +pub use matrix_sdk_base::store::StoreConfig; pub use request::RequestConfig; pub use sync::SyncSettings; diff --git a/crates/matrix-sdk/src/lib.rs b/crates/matrix-sdk/src/lib.rs index ad552656a..bb0c55640 100644 --- a/crates/matrix-sdk/src/lib.rs +++ b/crates/matrix-sdk/src/lib.rs @@ -50,6 +50,7 @@ mod http_client; /// High-level room API pub mod room; mod room_member; +pub mod store; mod sync; #[cfg(feature = "encryption")] diff --git a/crates/matrix-sdk/src/store.rs b/crates/matrix-sdk/src/store.rs new file mode 100644 index 000000000..25fcc90be --- /dev/null +++ b/crates/matrix-sdk/src/store.rs @@ -0,0 +1,22 @@ +// Copyright 2022 Kévin Commaille +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Functions and types to initialize a store. +//! +//! The re-exports present here depend on the store-related features that are +//! enabled. + +#[cfg(feature = "indexeddb_stores")] +pub use matrix_sdk_indexeddb::*; +#[cfg(any(feature = "sled_state_store", feature = "sled_cryptostore"))] +pub use matrix_sdk_sled::*;