[][src]Trait growthring::wal::WALFile

pub trait WALFile {
#[must_use]    pub fn allocate<'life0, 'async_trait>(
        &'life0 self,
        offset: WALPos,
        length: usize
    ) -> Pin<Box<dyn Future<Output = Result<(), ()>> + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] pub fn write<'life0, 'async_trait>(
        &'life0 self,
        offset: WALPos,
        data: WALBytes
    ) -> Pin<Box<dyn Future<Output = Result<(), ()>> + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] pub fn read<'life0, 'async_trait>(
        &'life0 self,
        offset: WALPos,
        length: usize
    ) -> Pin<Box<dyn Future<Output = Result<Option<WALBytes>, ()>> + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
pub fn truncate(&self, length: usize) -> Result<(), ()>; }

Required methods

#[must_use]pub fn allocate<'life0, 'async_trait>(
    &'life0 self,
    offset: WALPos,
    length: usize
) -> Pin<Box<dyn Future<Output = Result<(), ()>> + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Initialize the file space in [offset, offset + length) to zero.

#[must_use]pub fn write<'life0, 'async_trait>(
    &'life0 self,
    offset: WALPos,
    data: WALBytes
) -> Pin<Box<dyn Future<Output = Result<(), ()>> + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

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).

#[must_use]pub fn read<'life0, 'async_trait>(
    &'life0 self,
    offset: WALPos,
    length: usize
) -> Pin<Box<dyn Future<Output = Result<Option<WALBytes>, ()>> + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Read data with offset. Return Ok(None) when it reaches EOF.

pub fn truncate(&self, length: usize) -> Result<(), ()>[src]

Truncate a file to a specified length.

Loading content...

Implementors

impl WALFile for WALFileAIO[src]

Loading content...