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
impl WalCheckpointJob
Sourcepub fn new(db: impl AsRef<Path>, policy: WalCheckpointPolicy) -> Result<Self>
pub fn new(db: impl AsRef<Path>, policy: WalCheckpointPolicy) -> Result<Self>
A job for the database at db, idle from now.
Sourcepub fn policy(&self) -> WalCheckpointPolicy
pub fn policy(&self) -> WalCheckpointPolicy
The policy this job was built with.
Sourcepub fn note_activity(&self)
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.
Sourcepub fn note_activity_at(&self, now: Instant)
pub fn note_activity_at(&self, now: Instant)
Self::note_activity at now, for callers that keep their own clock.
Sourcepub fn tick(&self, conn: &Connection) -> Result<Option<WalCheckpointRun>>
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.
Sourcepub fn tick_at(
&self,
conn: &Connection,
now: Instant,
) -> Result<Option<WalCheckpointRun>>
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§
Auto Trait Implementations§
impl !Freeze for WalCheckpointJob
impl RefUnwindSafe for WalCheckpointJob
impl Send for WalCheckpointJob
impl Sync for WalCheckpointJob
impl Unpin for WalCheckpointJob
impl UnsafeUnpin for WalCheckpointJob
impl UnwindSafe for WalCheckpointJob
Blanket Implementations§
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