Trait growthring::wal::WALFile
source · pub trait WALFile {
// Required methods
fn allocate<'life0, 'async_trait>(
&'life0 self,
offset: WALPos,
length: usize
) -> Pin<Box<dyn Future<Output = Result<(), ()>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn write<'life0, 'async_trait>(
&'life0 self,
offset: WALPos,
data: WALBytes
) -> Pin<Box<dyn Future<Output = Result<(), ()>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn read<'life0, 'async_trait>(
&'life0 self,
offset: WALPos,
length: usize
) -> Pin<Box<dyn Future<Output = Result<Option<WALBytes>, ()>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn truncate(&self, length: usize) -> Result<(), ()>;
}
Required Methods§
sourcefn allocate<'life0, 'async_trait>(
&'life0 self,
offset: WALPos,
length: usize
) -> Pin<Box<dyn Future<Output = Result<(), ()>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn allocate<'life0, 'async_trait>(
&'life0 self,
offset: WALPos,
length: usize
) -> Pin<Box<dyn Future<Output = Result<(), ()>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Initialize the file space in [offset, offset + length) to zero.
sourcefn write<'life0, 'async_trait>(
&'life0 self,
offset: WALPos,
data: WALBytes
) -> Pin<Box<dyn Future<Output = Result<(), ()>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn write<'life0, 'async_trait>(
&'life0 self,
offset: WALPos,
data: WALBytes
) -> Pin<Box<dyn Future<Output = Result<(), ()>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Write data with offset. We assume all previous allocate
/truncate
invocations are visible
if ordered earlier (should be guaranteed by most OS). Additionally, the write caused
by each invocation of this function should be atomic (the entire single write should be
all or nothing).