use crate::block::BlockStore;
use crate::key_value::KeyValueStore;
use anyhow::Result;
use async_trait::async_trait;
use std::fmt::Debug;
#[cfg(not(target_arch = "wasm32"))]
pub trait StorageSendSync: Send + Sync {}
#[cfg(not(target_arch = "wasm32"))]
impl<T> StorageSendSync for T where T: Send + Sync {}
#[cfg(target_arch = "wasm32")]
pub trait StorageSendSync {}
#[cfg(target_arch = "wasm32")]
impl<T> StorageSendSync for T {}
#[cfg_attr(not(target_arch = "wasm32"), async_trait)]
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
pub trait Storage: Clone + StorageSendSync + Debug {
type BlockStore: BlockStore;
type KeyValueStore: KeyValueStore;
async fn get_block_store(&self, name: &str) -> Result<Self::BlockStore>;
async fn get_key_value_store(&self, name: &str) -> Result<Self::KeyValueStore>;
}