[][src]Trait kernel::hil::log::LogWrite

pub trait LogWrite<'a> {
    fn set_append_client(&'a self, append_client: &'a dyn LogWriteClient);
fn append(
        &self,
        buffer: &'static mut [u8],
        length: usize
    ) -> Result<(), (ReturnCode, Option<&'static mut [u8]>)>;
fn sync(&self) -> ReturnCode;
fn erase(&self) -> ReturnCode; }

An interface for writing to log storage.

Required methods

fn set_append_client(&'a self, append_client: &'a dyn LogWriteClient)

Set the client for appending from a log. The client will be called when writing operations complete.

fn append(
    &self,
    buffer: &'static mut [u8],
    length: usize
) -> Result<(), (ReturnCode, Option<&'static mut [u8]>)>

Append an entry to the end of the log. May fail if the entry is too large.

fn sync(&self) -> ReturnCode

Sync log to storage, making all entries persistent (not including any entries that were previously overwritten). There is no guarantee that any changes to the log are persistent until it is synced. In the event of an error, not all pages may be synced, but the log will remain in a valid state.

fn erase(&self) -> ReturnCode

Erase the entire log. In the event of a failure, only some pages may be erased, but the log will remain in a valid state.

Loading content...

Implementors

Loading content...