pub trait SectionStorage: Send + Sync {
// Required methods
fn initialize<E: Encode>(
&mut self,
header: &E,
) -> Result<usize, EncodeError>;
fn post_update_header<E: Encode>(
&mut self,
header: &E,
) -> Result<usize, EncodeError>;
fn append<E: Encode>(&mut self, entry: &E) -> Result<usize, EncodeError>;
fn flush(&mut self) -> CuResult<usize>;
// Provided method
fn is_sealed(&self) -> bool { ... }
}Expand description
A Storage is an append-only structure that can update a header section.
Required Methods§
Sourcefn initialize<E: Encode>(&mut self, header: &E) -> Result<usize, EncodeError>
fn initialize<E: Encode>(&mut self, header: &E) -> Result<usize, EncodeError>
This rewinds the storage, serialize the header and jumps to the beginning of the user data storage.
Sourcefn post_update_header<E: Encode>(
&mut self,
header: &E,
) -> Result<usize, EncodeError>
fn post_update_header<E: Encode>( &mut self, header: &E, ) -> Result<usize, EncodeError>
This updates the header leaving the position to the end of the user data storage.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".