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<(), (ErrorCode, &'static mut [u8])>; fn sync(&self) -> Result<(), ErrorCode>; fn erase(&self) -> Result<(), ErrorCode>; }
Expand description

An interface for writing to log storage.

Required Methods

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

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

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.

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.

Implementors