Skip to main content

Pager

Struct Pager 

Source
pub struct Pager { /* private fields */ }

Implementations§

Source§

impl Pager

Source

pub const CHECKSUM_METADATA_VERSION: u32 = 1

Source

pub fn new<P: AsRef<Path>>(path: P, cache_capacity: usize) -> Result<Self>

Source

pub fn new_in_memory(cache_capacity: usize) -> Result<Self>

Source

pub fn read_page(&mut self, page_id: PageId) -> Result<Page>

Source

pub fn write_page(&mut self, page: Page) -> Result<()>

Source

pub fn allocate_page(&mut self) -> Result<PageId>

Source

pub fn deallocate_page(&mut self, page_id: PageId) -> Result<()>

Source

pub fn flush(&mut self) -> Result<()>

Source

pub fn begin_transaction(&mut self) -> Result<()>

Source

pub fn commit_transaction(&mut self) -> Result<()>

Source

pub fn rollback_transaction(&mut self) -> Result<()>

Source

pub fn transaction_active(&self) -> bool

Source

pub fn begin_read(&mut self) -> Result<()>

Source

pub fn end_read(&mut self) -> Result<()>

Source

pub fn free_pages(&self) -> &[PageId]

Source

pub fn set_free_pages(&mut self, free_pages: Vec<PageId>)

Source

pub fn checksum_entries(&self) -> Vec<(PageId, u32)>

Source

pub fn journal_mode(&self) -> JournalMode

Source

pub fn set_journal_mode(&mut self, journal_mode: JournalMode) -> Result<()>

Source

pub fn checkpoint_wal(&mut self) -> Result<()>

Source

pub fn replace_checksums(&mut self, checksums: HashMap<PageId, u32>)

Source

pub fn file_len(&self) -> Result<u64>

Source

pub fn allocated_page_count(&self) -> usize

Source

pub fn fragmented_free_page_count(&self) -> usize

Source

pub fn trailing_free_page_count(&self) -> usize

Source

pub fn validate_integrity(&mut self) -> Result<PagerIntegrityReport>

Trait Implementations§

Source§

impl Debug for Pager

Source§

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

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

impl Drop for Pager

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl Freeze for Pager

§

impl RefUnwindSafe for Pager

§

impl Send for Pager

§

impl Sync for Pager

§

impl Unpin for Pager

§

impl UnsafeUnpin for Pager

§

impl UnwindSafe for Pager

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> 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, 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.