test:encode

This commit is contained in:
weisd
2024-07-02 18:09:00 +08:00
parent 5eb6d52daf
commit d1a62f6697
8 changed files with 126 additions and 46 deletions
+3 -7
View File
@@ -2,6 +2,7 @@ use std::fmt::Debug;
use anyhow::Result;
use bytes::Bytes;
use tokio::io::DuplexStream;
#[async_trait::async_trait]
pub trait DiskAPI: Debug + Send + Sync + 'static {
@@ -9,13 +10,8 @@ pub trait DiskAPI: Debug + Send + Sync + 'static {
async fn read_all(&self, volume: &str, path: &str) -> Result<Bytes>;
async fn write_all(&self, volume: &str, path: &str, data: Bytes) -> Result<()>;
async fn rename_file(
&self,
src_volume: &str,
src_path: &str,
dst_volume: &str,
dst_path: &str,
) -> Result<()>;
async fn rename_file(&self, src_volume: &str, src_path: &str, dst_volume: &str, dst_path: &str) -> Result<()>;
async fn CreateFile(&self, origvolume: &str, volume: &str, path: &str, fileSize: usize, r: DuplexStream) -> Result<()>;
async fn make_volumes(&self, volume: Vec<&str>) -> Result<()>;
async fn make_volume(&self, volume: &str) -> Result<()>;