Skip to main content

WalCheckpointJob

Struct WalCheckpointJob 

Source
pub struct WalCheckpointJob { /* private fields */ }
Expand description

A checkpoint job for one database. Share it by reference; it holds no connection.

Implementations§

Source§

impl WalCheckpointJob

Source

pub fn new(db: impl AsRef<Path>, policy: WalCheckpointPolicy) -> Result<Self>

A job for the database at db, idle from now.

Source

pub fn policy(&self) -> WalCheckpointPolicy

The policy this job was built with.

Source

pub fn note_activity(&self)

Records that the database was used now. Call it on every use; a RESTART needs the database to have been idle for quiet_for.

Source

pub fn note_activity_at(&self, now: Instant)

Self::note_activity at now, for callers that keep their own clock.

Source

pub fn tick(&self, conn: &Connection) -> Result<Option<WalCheckpointRun>>

Runs the checkpoint due now on conn, the writer for this database, if the policy calls for one. Ok(None) when nothing is due or another tick is still running.

Source

pub fn tick_at( &self, conn: &Connection, now: Instant, ) -> Result<Option<WalCheckpointRun>>

Self::tick at now, for callers that keep their own clock.

Trait Implementations§

Source§

impl Debug for WalCheckpointJob

Source§

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

Formats the value using the given formatter. Read more

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