SectionStorage

Trait SectionStorage 

pub trait SectionStorage: Send + Sync {
    // Required methods
    fn initialize<E>(&mut self, header: &E) -> Result<usize, EncodeError>
       where E: Encode;
    fn post_update_header<E>(
        &mut self,
        header: &E,
    ) -> Result<usize, EncodeError>
       where E: Encode;
    fn append<E>(&mut self, entry: &E) -> Result<usize, EncodeError>
       where E: Encode;
    fn flush(&mut self) -> Result<usize, CuError>;
}
Expand description

A Storage is an append-only structure that can update a header section.

Required Methods§

fn initialize<E>(&mut self, header: &E) -> Result<usize, EncodeError>
where E: Encode,

This rewinds the storage, serialize the header and jumps to the beginning of the user data storage.

fn post_update_header<E>(&mut self, header: &E) -> Result<usize, EncodeError>
where E: Encode,

This updates the header leaving the position to the end of the user data storage.

fn append<E>(&mut self, entry: &E) -> Result<usize, EncodeError>
where E: Encode,

Appends the entry to the user data storage.

fn flush(&mut self) -> Result<usize, CuError>

Flushes the section to the underlying storage

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§