pub trait IoContext:
Debug
+ Send
+ Sync {
// Required methods
fn base_dir(&self) -> &Path;
fn get_compressor(&self, entry_id: &EntryID) -> Arc<LiquidCompressorStates>;
fn arrow_path(&self, entry_id: &EntryID) -> PathBuf;
fn liquid_path(&self, entry_id: &EntryID) -> PathBuf;
fn read_file<'life0, 'async_trait>(
&'life0 self,
path: PathBuf,
) -> Pin<Box<dyn Future<Output = Result<Bytes, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn read_range<'life0, 'async_trait>(
&'life0 self,
path: PathBuf,
range: Range<u64>,
) -> Pin<Box<dyn Future<Output = Result<Bytes, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn write_file<'life0, 'async_trait>(
&'life0 self,
path: PathBuf,
data: Bytes,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
A trait for objects that can handle IO operations for the cache.
Required Methods§
Sourcefn base_dir(&self) -> &Path
fn base_dir(&self) -> &Path
Get the base directory for the cache eviction, i.e., evicted data will be written to this directory.
Sourcefn get_compressor(&self, entry_id: &EntryID) -> Arc<LiquidCompressorStates>
fn get_compressor(&self, entry_id: &EntryID) -> Arc<LiquidCompressorStates>
Get the compressor for an entry.
Sourcefn arrow_path(&self, entry_id: &EntryID) -> PathBuf
fn arrow_path(&self, entry_id: &EntryID) -> PathBuf
Get the path to the arrow file for an entry.
Sourcefn liquid_path(&self, entry_id: &EntryID) -> PathBuf
fn liquid_path(&self, entry_id: &EntryID) -> PathBuf
Get the path to the liquid file for an entry.
Sourcefn read_file<'life0, 'async_trait>(
&'life0 self,
path: PathBuf,
) -> Pin<Box<dyn Future<Output = Result<Bytes, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn read_file<'life0, 'async_trait>(
&'life0 self,
path: PathBuf,
) -> Pin<Box<dyn Future<Output = Result<Bytes, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Read the entire file at the given path.