pub enum CheckpointMode {
Passive {
upper_bound_inclusive: Option<u64>,
},
Full,
Restart,
Truncate {
upper_bound_inclusive: Option<u64>,
},
}Variants§
Passive
Checkpoint as many frames as possible without waiting for any database readers or writers to finish, then sync the database file if all frames in the log were checkpointed. Passive never blocks readers or writers, only ensures (like all modes do) that there are no other checkpointers.
Optional upper_bound_inclusive parameter can be set in order to checkpoint frames with number no larger than the parameter
Full
This mode blocks until there is no database writer and all readers are reading from the most recent database snapshot. It then checkpoints all frames in the log file and syncs the database file. This mode blocks new database writers while it is pending, but new database readers are allowed to continue unimpeded.
Restart
This mode works the same way as Full with the addition that after checkpointing the log file it blocks (calls the busy-handler callback) until all readers are reading from the database file only. This ensures that the next writer will restart the log file from the beginning. Like Full, this mode blocks new database writer attempts while it is pending, but does not impede readers.
Truncate
This mode works the same way as Restart with the addition that it also truncates the log file to zero bytes just prior to a successful return.
Extra parameter can be set in order to perform conditional TRUNCATE: database will be checkpointed and truncated only if max_frames equals to the parameter value this behaviour used by sync-engine which consolidate WAL before checkpoint and needs to be sure that no frames will be missed
Trait Implementations§
Source§impl Clone for CheckpointMode
impl Clone for CheckpointMode
Source§fn clone(&self) -> CheckpointMode
fn clone(&self) -> CheckpointMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for CheckpointMode
Source§impl Debug for CheckpointMode
impl Debug for CheckpointMode
Source§impl FromStr for CheckpointMode
impl FromStr for CheckpointMode
Source§impl PartialEq for CheckpointMode
impl PartialEq for CheckpointMode
impl StructuralPartialEq for CheckpointMode
Auto Trait Implementations§
impl Freeze for CheckpointMode
impl RefUnwindSafe for CheckpointMode
impl Send for CheckpointMode
impl Sync for CheckpointMode
impl Unpin for CheckpointMode
impl UnsafeUnpin for CheckpointMode
impl UnwindSafe for CheckpointMode
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more