refactor(ecstore): DiskAPI::write_all use Bytes

This commit is contained in:
Nugine
2025-06-17 16:22:55 +08:00
parent e254ddc947
commit e520299c4b
6 changed files with 22 additions and 22 deletions
+2 -2
View File
@@ -364,7 +364,7 @@ impl DiskAPI for Disk {
}
#[tracing::instrument(skip(self))]
async fn write_all(&self, volume: &str, path: &str, data: Vec<u8>) -> Result<()> {
async fn write_all(&self, volume: &str, path: &str, data: Bytes) -> Result<()> {
match self {
Disk::Local(local_disk) => local_disk.write_all(volume, path, data).await,
Disk::Remote(remote_disk) => remote_disk.write_all(volume, path, data).await,
@@ -504,7 +504,7 @@ pub trait DiskAPI: Debug + Send + Sync + 'static {
// ReadParts
async fn read_multiple(&self, req: ReadMultipleReq) -> Result<Vec<ReadMultipleResp>>;
// CleanAbandonedData
async fn write_all(&self, volume: &str, path: &str, data: Vec<u8>) -> Result<()>;
async fn write_all(&self, volume: &str, path: &str, data: Bytes) -> Result<()>;
async fn read_all(&self, volume: &str, path: &str) -> Result<Vec<u8>>;
async fn disk_info(&self, opts: &DiskInfoOptions) -> Result<DiskInfo>;
async fn ns_scanner(