test: AsyncWrite

This commit is contained in:
weisd
2024-07-10 11:44:58 +08:00
parent 98b4422956
commit 3e77ca6497
5 changed files with 90 additions and 34 deletions
+2 -1
View File
@@ -11,12 +11,13 @@ use crate::store_api::{FileInfo, RawFileInfo};
#[async_trait::async_trait]
pub trait DiskAPI: Debug + Send + Sync + 'static {
fn is_local(&self) -> bool;
fn id(&self) -> Uuid;
async fn read_all(&self, volume: &str, path: &str) -> Result<Bytes>;
async fn write_all(&self, volume: &str, path: &str, data: Vec<u8>) -> Result<()>;
async fn rename_file(&self, src_volume: &str, src_path: &str, dst_volume: &str, dst_path: &str) -> Result<()>;
async fn create_file(&self, origvolume: &str, volume: &str, path: &str, file_size: usize, r: DuplexStream) -> Result<()>;
async fn append_file(&self, volume: &str, path: &str, r: DuplexStream) -> Result<()>;
async fn append_file(&self, volume: &str, path: &str, r: &[u8]) -> Result<()>;
async fn rename_data(
&self,
src_volume: &str,