Skip to main content

PersistentHeaderV3

Struct PersistentHeaderV3 

Source
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: u32

File format version (should be V3_FORMAT_VERSION)

§flags: u32

Feature flags bitfield

§node_count: u64

Total number of nodes in the file

§edge_count: u64

Total number of edges in the file

§schema_version: u32

Schema version

§reserved: u32

Reserved field (for future use)

§node_data_offset: u64

V3: 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: u64

V3: 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: u64

Offset where outgoing edge clusters begin (V2 compat, still byte offset)

§incoming_cluster_offset: u64

Offset where incoming edge clusters begin (V2 compat, still byte offset)

§free_space_offset: u64

Offset where free space management begins (V2 compat, still byte offset)

§root_index_page: u64

Root B+Tree index page ID (0 if tree is empty)

§free_page_list_head: u64

Head of free page list for page reuse (0 if none)

§total_pages: u64

Total number of pages allocated in the file

§page_size: u32

Page size in bytes (typically 4096)

§btree_height: u32

Current B+Tree height (0 if empty)

Implementations§

Source§

impl PersistentHeaderV3

Source

pub fn new_v3() -> Self

Create a new persistent header with default V3 values

Source

pub fn to_bytes(&self) -> [u8; 112]

Serialize the header to a byte array

Source

pub fn validate(&self) -> NativeResult<()>

Validate persistent header for consistency

Source

pub fn from_bytes(bytes: &[u8]) -> NativeResult<Self>

Parse a header from a byte slice

Source

pub fn detect_version(bytes: &[u8]) -> NativeResult<u32>

Detect the version of a header from raw bytes

Trait Implementations§

Source§

impl Clone for PersistentHeaderV3

Source§

fn clone(&self) -> PersistentHeaderV3

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PersistentHeaderV3

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for PersistentHeaderV3

Source§

impl PartialEq for PersistentHeaderV3

Source§

fn eq(&self, other: &PersistentHeaderV3) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for PersistentHeaderV3

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V