IndexEntry

Trait IndexEntry 

Source
pub trait IndexEntry: Sized {
    // Required methods
    fn entry_type() -> [u8; 2];
    fn new(starting_number: u64, offsets: Vec<i64>) -> Self;
    fn starting_number(&self) -> u64;
    fn offsets(&self) -> &[i64];

    // Provided methods
    fn to_entry(&self) -> Entry { ... }
    fn from_entry(entry: &Entry) -> Result<Self, E2sError> { ... }
}
Expand description

Serialize and deserialize index entries with format: starting-number | offsets... | count

Required Methods§

Source

fn entry_type() -> [u8; 2]

Get the entry type identifier for this index

Source

fn new(starting_number: u64, offsets: Vec<i64>) -> Self

Create a new instance with starting number and offsets

Source

fn starting_number(&self) -> u64

Get the starting number - can be starting slot or block number for example

Source

fn offsets(&self) -> &[i64]

Get the offsets vector

Provided Methods§

Source

fn to_entry(&self) -> Entry

Convert to an Entry for storage in an e2store file Format: starting-number | offset1 | offset2 | … | count

Source

fn from_entry(entry: &Entry) -> Result<Self, E2sError>

Create from an Entry

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§