Skip to main content

Wal

Struct Wal 

Source
pub struct Wal<S: Source> { /* private fields */ }
Expand description

A -wal file, read up to its last commit.

Implementations§

Source§

impl<S: Source> Wal<S>

Source

pub fn open(source: S) -> Result<Wal<S>>

Read and validate a -wal file.

An empty file is not an error: sqlite leaves a zero length -wal behind after a checkpoint, and so does a database that has been in wal mode but never written to.

Source

pub fn is_empty(&self) -> bool

Whether the log contributes anything at all.

Source

pub fn page_size(&self) -> u32

Page size the log was written with. Zero for an empty log.

Source

pub fn page_count(&self) -> u32

Database size in pages as of the last commit, zero for an empty log.

Source

pub fn frame_counts(&self) -> (u32, u32)

Frames the log holds, and how many of them survived validation and ended at a commit.

Source

pub fn read_page_part( &self, number: u32, offset: u32, buf: &mut [u8], ) -> Result<bool>

Read buf.len() bytes of page number starting offset bytes into it, if the log holds a committed version of that page.

Auto Trait Implementations§

§

impl<S> Freeze for Wal<S>
where S: Freeze,

§

impl<S> RefUnwindSafe for Wal<S>
where S: RefUnwindSafe,

§

impl<S> Send for Wal<S>
where S: Send,

§

impl<S> Sync for Wal<S>
where S: Sync,

§

impl<S> Unpin for Wal<S>
where S: Unpin,

§

impl<S> UnsafeUnpin for Wal<S>
where S: UnsafeUnpin,

§

impl<S> UnwindSafe for Wal<S>
where S: UnwindSafe,

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

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.