pub trait CacheOps: Send + Sync {
// Required methods
fn read_at<'life0, 'life1, 'async_trait>(
&'life0 self,
offset: u64,
out: &'life1 mut [u8],
) -> Pin<Box<dyn Future<Output = GibbloxResult<usize>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn write_at<'life0, 'life1, 'async_trait>(
&'life0 self,
offset: u64,
data: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = GibbloxResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn set_len<'life0, 'async_trait>(
&'life0 self,
len: u64,
) -> Pin<Box<dyn Future<Output = GibbloxResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn flush<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = GibbloxResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Backend I/O abstraction for a single cache file.
Implementations are expected to be internally synchronized; the cache wrapper may call these methods concurrently from multiple tasks.
Required Methods§
Sourcefn read_at<'life0, 'life1, 'async_trait>(
&'life0 self,
offset: u64,
out: &'life1 mut [u8],
) -> Pin<Box<dyn Future<Output = GibbloxResult<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_at<'life0, 'life1, 'async_trait>(
&'life0 self,
offset: u64,
out: &'life1 mut [u8],
) -> Pin<Box<dyn Future<Output = GibbloxResult<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Read bytes at a fixed offset. Returns the number of bytes read.
Sourcefn write_at<'life0, 'life1, 'async_trait>(
&'life0 self,
offset: u64,
data: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = GibbloxResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn write_at<'life0, 'life1, 'async_trait>(
&'life0 self,
offset: u64,
data: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = GibbloxResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Write all bytes at a fixed offset.