mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2025-12-24 00:01:03 -05:00
feat(indexeddb): add fn to media store builder for prefixing db name
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
This commit is contained in:
committed by
Ivan Enderlin
parent
2cfcc957ca
commit
2bec882c83
@@ -44,6 +44,16 @@ impl IndexeddbMediaStoreBuilder {
|
||||
/// [`IndexeddbMediaStore`]
|
||||
pub const DEFAULT_DATABASE_NAME: &'static str = "media";
|
||||
|
||||
/// Create a new [`IndexeddbMediaStoreBuilder`] where the database name is
|
||||
/// constructed by joining the given prefix with
|
||||
/// [`Self::DEFAULT_DATABASE_NAME`] and separated by `::`.
|
||||
pub fn with_prefix(prefix: &str) -> Self {
|
||||
Self {
|
||||
database_name: format!("{}::{}", prefix, Self::DEFAULT_DATABASE_NAME),
|
||||
store_cipher: None,
|
||||
}
|
||||
}
|
||||
|
||||
/// Sets the name of the IndexedDB database which will be opened. This
|
||||
/// defaults to [`Self::DEFAULT_DATABASE_NAME`].
|
||||
pub fn database_name(mut self, name: String) -> Self {
|
||||
|
||||
Reference in New Issue
Block a user