pub struct HeaderNode {
pub tsn: Tsn,
pub free_lists_tree_root_id: PageID,
pub events_tree_root_id: PageID,
pub tags_tree_root_id: PageID,
pub next_page_id: PageID,
pub next_position: Position,
pub schema_version: u32,
pub tracking_root_page_id: PageID,
}Fields§
§tsn: Tsn§free_lists_tree_root_id: PageID§events_tree_root_id: PageID§next_page_id: PageID§next_position: Position§schema_version: u32On-disk schema version for the header node
tracking_root_page_id: PageIDImplementations§
Source§impl HeaderNode
impl HeaderNode
Sourcepub fn calc_serialized_size(&self) -> usize
pub fn calc_serialized_size(&self) -> usize
Writes the serialized HeaderNode into the provided buffer and returns the number of bytes written (52). The buffer must be at least 52 bytes long.
pub fn serialize_into(&self, buf: &mut [u8]) -> usize
Sourcepub fn from_slice(slice: &[u8]) -> DCBResult<Self>
pub fn from_slice(slice: &[u8]) -> DCBResult<Self>
Creates a HeaderNode from a byte slice Accepts legacy 48-byte layout (no schema, schema_version=0) or the current 52-byte layout (schema as u32 at the end). Layout (first 48 bytes):
- 8 bytes for tsn
- 8 bytes for next_page_id
- 8 bytes for free_lists_tree_root_id
- 8 bytes for events_tree_root_id
- 8 bytes for tags_tree_root_id
- 8 bytes for next_position
§Arguments
slice- The byte slice to deserialize from
§Returns
Result<Self>- The deserialized HeaderNode or an error
Trait Implementations§
Source§impl Clone for HeaderNode
impl Clone for HeaderNode
Source§fn clone(&self) -> HeaderNode
fn clone(&self) -> HeaderNode
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HeaderNode
impl Debug for HeaderNode
Source§impl Default for HeaderNode
impl Default for HeaderNode
Source§impl PartialEq for HeaderNode
impl PartialEq for HeaderNode
impl Eq for HeaderNode
impl StructuralPartialEq for HeaderNode
Auto Trait Implementations§
impl Freeze for HeaderNode
impl RefUnwindSafe for HeaderNode
impl Send for HeaderNode
impl Sync for HeaderNode
impl Unpin for HeaderNode
impl UnwindSafe for HeaderNode
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<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>
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