diff options
author | Vika <vika@fireburn.ru> | 2024-08-01 19:48:37 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2024-08-01 20:40:00 +0300 |
commit | 7e8e688e2e58f9c944b941e768ab7b034a348a1f (patch) | |
tree | 1068469c6b9b97bac407038276fd8971b2101e48 /src/media/storage/mod.rs | |
parent | 57a9c3c7e520714928904fc7e2ff3d62ac2b2467 (diff) | |
download | kittybox-7e8e688e2e58f9c944b941e768ab7b034a348a1f.tar.zst |
treewide: create a common method for state initialization
Now the database objects can be uniformly created from a URI. They can also optionally do sanity checks and one-time initialization.
Diffstat (limited to 'src/media/storage/mod.rs')
-rw-r--r-- | src/media/storage/mod.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/media/storage/mod.rs b/src/media/storage/mod.rs index 020999c..38410e6 100644 --- a/src/media/storage/mod.rs +++ b/src/media/storage/mod.rs @@ -86,6 +86,8 @@ pub type Result<T> = std::result::Result<T, MediaStoreError>; #[async_trait] pub trait MediaStore: 'static + Send + Sync + Clone { + // Initialize self from a URL, possibly performing asynchronous initialization. + async fn new(url: &'_ url::Url) -> Result<Self>; async fn write_streaming<T>( &self, domain: &str, |