pub struct DatabaseHeader {Show 16 fields
pub magic: [u8; 8],
pub page_size: u16,
pub version: u16,
pub change_counter: u32,
pub total_pages: u32,
pub freelist_trunk: u32,
pub freelist_count: u32,
pub schema_cookie: u32,
pub user_version: u32,
pub vector_index_page: u32,
pub wal_sequence: u32,
pub header_crc32: u32,
pub encryption_flags: u8,
pub salt: [u8; 16],
pub kcv: [u8; 16],
pub compression_flags: u8,
}Expand description
The 100-byte Database Header located at Offset 0..99 of Page 1
Fields§
§magic: [u8; 8]Magic bytes: b"TAPIRUS\0"
page_size: u16Page size in bytes (e.g. 4096)
version: u16Format version
change_counter: u32Change counter incremented on commits
total_pages: u32Total number of pages in file
freelist_trunk: u32First page of freelist trunk
freelist_count: u32Number of free pages
Schema cookie incremented on DDL mutations
user_version: u32User version for migrations
vector_index_page: u32Root page of Vector Directory
wal_sequence: u32Active WAL sequence
header_crc32: u32Checksum over header bytes
encryption_flags: u8Encryption mode: 0 = Plaintext, 1 = ChaCha20-Poly1305 AEAD
salt: [u8; 16]16-byte random Database Salt
kcv: [u8; 16]16-byte Key Check Value (KCV) tag for key authentication
compression_flags: u8Transparent Page Compression mode: 0 = None, 1 = LZ4 Block
Implementations§
Source§impl DatabaseHeader
impl DatabaseHeader
Sourcepub fn calculate_crc(&self) -> u32
pub fn calculate_crc(&self) -> u32
Calculate CRC32 checksum over the first 44 bytes of the header
Sourcepub fn from_bytes(slice: &[u8]) -> Result<Self>
pub fn from_bytes(slice: &[u8]) -> Result<Self>
Parse header from 100-byte slice and verify CRC32
Trait Implementations§
Source§impl Clone for DatabaseHeader
impl Clone for DatabaseHeader
Source§impl Debug for DatabaseHeader
impl Debug for DatabaseHeader
Source§impl Default for DatabaseHeader
impl Default for DatabaseHeader
impl Eq for DatabaseHeader
Source§impl PartialEq for DatabaseHeader
impl PartialEq for DatabaseHeader
impl StructuralPartialEq for DatabaseHeader
Auto Trait Implementations§
impl Forget for DatabaseHeader
impl Freeze for DatabaseHeader
impl Move for DatabaseHeader
impl RefUnwindSafe for DatabaseHeader
impl Send for DatabaseHeader
impl Sync for DatabaseHeader
impl Unpin for DatabaseHeader
impl UnsafeUnpin for DatabaseHeader
impl UnwindSafe for DatabaseHeader
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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
Compare self to
key and return true if they are equal.