pub struct PageEntry {
pub offset: u64,
pub length: u32,
pub start_block: u64,
pub start_logical: u64,
}Expand description
Master index entry pointing to a serialized index page.
Each PageEntry describes the location of an index page containing up to
ENTRIES_PER_PAGE block metadata records. The master index is an array
of these entries, stored at the end of the snapshot file.
§Fields
- offset: Physical byte offset of the serialized index page
- length: Size of the serialized page in bytes
- start_block: Global block index of the first block in this page
- start_logical: Logical byte offset where this page’s coverage begins
§Usage
To find the page covering logical offset O:
binary_search(master.disk_pages, |p| p.start_logical.cmp(&O))§Serialization
Pages are serialized using bincode and stored contiguously before the
master index. The page entry provides the offset and length for deserialization.
§Examples
use hexz_core::format::index::PageEntry;
let entry = PageEntry {
offset: 1048576, // Page starts at 1MB
length: 65536, // Page is 64KB serialized
start_block: 0, // First block is block #0
start_logical: 0, // Covers logical bytes 0..N
};Fields§
§offset: u64Physical offset of the index page in the snapshot file.
length: u32Serialized size of the index page in bytes.
start_block: u64Global block index of the first block in this page.
start_logical: u64Logical byte offset where this page’s coverage begins.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PageEntry
impl<'de> Deserialize<'de> for PageEntry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PageEntry
impl RefUnwindSafe for PageEntry
impl Send for PageEntry
impl Sync for PageEntry
impl Unpin for PageEntry
impl UnsafeUnpin for PageEntry
impl UnwindSafe for PageEntry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more