mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-21 03:46:37 +00:00
use anyhow:Result
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
use std::fmt::Debug;
|
||||
|
||||
use anyhow::Error;
|
||||
use anyhow::Result;
|
||||
use bytes::Bytes;
|
||||
|
||||
#[async_trait::async_trait]
|
||||
pub trait DiskAPI: Debug + Send + Sync + 'static {
|
||||
async fn read_all(&self, volume: &str, path: &str) -> Result<Bytes, Error>;
|
||||
async fn write_all(&self, volume: &str, path: &str, data: Bytes) -> Result<(), Error>;
|
||||
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<(), Error>;
|
||||
) -> Result<()>;
|
||||
|
||||
async fn make_volumes(&self, volume: Vec<&str>) -> Result<(), Error>;
|
||||
async fn make_volume(&self, volume: &str) -> Result<(), Error>;
|
||||
async fn make_volumes(&self, volume: Vec<&str>) -> Result<()>;
|
||||
async fn make_volume(&self, volume: &str) -> Result<()>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user