pub struct PersistentHeaderV3 {Show 17 fields
pub magic: [u8; 8],
pub version: u32,
pub flags: u32,
pub node_count: u64,
pub edge_count: u64,
pub schema_version: u32,
pub reserved: u32,
pub node_data_offset: u64,
pub edge_data_offset: u64,
pub outgoing_cluster_offset: u64,
pub incoming_cluster_offset: u64,
pub free_space_offset: u64,
pub root_index_page: u64,
pub free_page_list_head: u64,
pub total_pages: u64,
pub page_size: u32,
pub btree_height: u32,
}Expand description
V3 Persistent header that is written to disk
This header contains ONLY the fields that must be persisted across file closes. Transaction state and rollback metadata are handled separately in runtime.
Fields§
§magic: [u8; 8]Magic number (should be V3_MAGIC)
version: u32File format version (should be V3_FORMAT_VERSION)
flags: u32Feature flags bitfield
node_count: u64Total number of nodes in the file
edge_count: u64Total number of edges in the file
schema_version: u32Schema version
reserved: u32Reserved field (for future use)
node_data_offset: u64V3: NodeStore’s B+Tree root page ID (value 0 = uninitialized, >= 1 = valid page ID) Note: Field name “node_data_offset” is kept for V2 compatibility, but stores a page ID in V3
edge_data_offset: u64V3: EdgeStore’s B+Tree root page ID (value 0 = uninitialized, >= 1 = valid page ID) Note: Field name “edge_data_offset” is kept for V2 compatibility, but stores a page ID in V3
outgoing_cluster_offset: u64Offset where outgoing edge clusters begin (V2 compat, still byte offset)
incoming_cluster_offset: u64Offset where incoming edge clusters begin (V2 compat, still byte offset)
free_space_offset: u64Offset where free space management begins (V2 compat, still byte offset)
root_index_page: u64Root B+Tree index page ID (0 if tree is empty)
free_page_list_head: u64Head of free page list for page reuse (0 if none)
total_pages: u64Total number of pages allocated in the file
page_size: u32Page size in bytes (typically 4096)
btree_height: u32Current B+Tree height (0 if empty)
Implementations§
Source§impl PersistentHeaderV3
impl PersistentHeaderV3
Sourcepub fn validate(&self) -> NativeResult<()>
pub fn validate(&self) -> NativeResult<()>
Validate persistent header for consistency
Sourcepub fn from_bytes(bytes: &[u8]) -> NativeResult<Self>
pub fn from_bytes(bytes: &[u8]) -> NativeResult<Self>
Parse a header from a byte slice
Sourcepub fn detect_version(bytes: &[u8]) -> NativeResult<u32>
pub fn detect_version(bytes: &[u8]) -> NativeResult<u32>
Detect the version of a header from raw bytes
Trait Implementations§
Source§impl Clone for PersistentHeaderV3
impl Clone for PersistentHeaderV3
Source§fn clone(&self) -> PersistentHeaderV3
fn clone(&self) -> PersistentHeaderV3
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PersistentHeaderV3
impl Debug for PersistentHeaderV3
impl Eq for PersistentHeaderV3
Source§impl PartialEq for PersistentHeaderV3
impl PartialEq for PersistentHeaderV3
Source§fn eq(&self, other: &PersistentHeaderV3) -> bool
fn eq(&self, other: &PersistentHeaderV3) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PersistentHeaderV3
Auto Trait Implementations§
impl Freeze for PersistentHeaderV3
impl RefUnwindSafe for PersistentHeaderV3
impl Send for PersistentHeaderV3
impl Sync for PersistentHeaderV3
impl Unpin for PersistentHeaderV3
impl UnsafeUnpin for PersistentHeaderV3
impl UnwindSafe for PersistentHeaderV3
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
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>
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