1use std::ops::Range;
3
4use ailake_core::AilakeResult;
5use async_trait::async_trait;
6use bytes::Bytes;
7
8#[async_trait]
11pub trait Store: Send + Sync {
12 async fn get(&self, path: &str) -> AilakeResult<Bytes>;
13
14 async fn get_range(&self, path: &str, range: Range<u64>) -> AilakeResult<Bytes>;
16
17 async fn put(&self, path: &str, data: Bytes) -> AilakeResult<()>;
18
19 async fn list(&self, prefix: &str) -> AilakeResult<Vec<String>>;
20
21 async fn file_size(&self, path: &str) -> AilakeResult<u64>;
22
23 async fn exists(&self, path: &str) -> AilakeResult<bool>;
24
25 async fn delete(&self, path: &str) -> AilakeResult<()>;
26}