use async_trait::async_trait;
use serde::Deserialize;
use crate::combinable_dir::CombinableDir;
use crate::static_combinable::StaticCombinableFile;
#[async_trait]
pub trait CloudDriver<Config, State>: GetVfs
where Config: Clone + Send + Sync + for<'a> Deserialize<'a>
{
fn new(state: State) -> Self;
fn driver_name() -> &'static str;
async fn load_config(config: Config) -> State;
async fn reload_vfs(state: &State) -> Result<CombinableDir<StaticCombinableFile>, String>;
}
#[async_trait]
pub trait GetVfs: Send + Sync {
async fn get_vfs(&self) -> Result<CombinableDir<StaticCombinableFile>, String>;
}