Skip to main content

Header

Struct Header 

Source
pub struct Header {
Show 14 fields pub page_size: u32, pub reserved_space: u8, pub wal_mode: bool, pub file_change_counter: u32, pub header_page_count: Option<u32>, pub first_freelist_trunk: u32, pub freelist_page_count: u32, pub schema_cookie: u32, pub schema_format: u32, pub text_encoding: TextEncoding, pub user_version: i32, pub application_id: i32, pub largest_root_page: u32, pub sqlite_version_number: u32,
}

Fields§

§page_size: u32

Bytes per page, 512 to 65536, always a power of two.

§reserved_space: u8

Unused bytes at the end of every page. Usually zero; extensions use it for per page trailers.

§wal_mode: bool

Whether the database uses a write-ahead log. On its own this says nothing about whether the main file is complete: see the note at the top of this file.

§file_change_counter: u32§header_page_count: Option<u32>

Page count as stated in the header, only present when the header says it is current. Callers should prefer Reader::page_count.

§first_freelist_trunk: u32§freelist_page_count: u32§schema_cookie: u32§schema_format: u32

1 to 4. Format 4 is what any SQLite since 2006 writes.

§text_encoding: TextEncoding§user_version: i32§application_id: i32§largest_root_page: u32

Non zero when the database is in auto vacuum mode, in which case pointer map pages are interleaved with the data.

§sqlite_version_number: u32

Implementations§

Source§

impl Header

Source

pub fn usable_size(&self) -> u32

Bytes of each page the b-tree layer may use. Everything in the file that indexes into a page is bounded by this, not by the page size.

Source

pub fn parse(bytes: &[u8]) -> Result<Header>

Trait Implementations§

Source§

impl Clone for Header

Source§

fn clone(&self) -> Self

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 Header

Source§

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

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

impl Eq for Header

Source§

impl PartialEq for Header

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Header

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<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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.