Skip to main content

SectionStorage

Trait SectionStorage 

Source
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§

Source

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.

Source

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.

Source

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

Appends the entry to the user data storage.

Source

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

Implementors§