use std::path::Path;
use async_trait::async_trait;
use crate::error::Result;
use crate::types::{FileEntry, FileMeta};
#[async_trait]
pub trait RemoteFileSystem: Send {
async fn connect(&mut self) -> Result<()>;
async fn disconnect(&mut self) -> Result<()>;
fn is_connected(&self) -> bool;
async fn list(&mut self, path: &str) -> Result<Vec<FileEntry>>;
async fn metadata(&mut self, path: &str) -> Result<FileMeta>;
async fn exists(&mut self, path: &str) -> Result<bool>;
async fn mkdir(&mut self, path: &str) -> Result<()>;
async fn mkdir_all(&mut self, path: &str) -> Result<()>;
async fn rmdir(&mut self, path: &str) -> Result<()>;
async fn remove_file(&mut self, path: &str) -> Result<()>;
async fn remove(&mut self, path: &str) -> Result<()>;
async fn rename(&mut self, from: &str, to: &str) -> Result<()>;
async fn read(&mut self, path: &str) -> Result<Vec<u8>>;
async fn write(&mut self, path: &str, data: &[u8]) -> Result<()>;
async fn download(&mut self, remote: &str, local: &Path) -> Result<()>;
async fn upload(&mut self, local: &Path, remote: &str) -> Result<()>;
}