pub struct WalBackendAdapter<F: VfsFile> { /* private fields */ }Implementations§
Source§impl<F: VfsFile> WalBackendAdapter<F>
impl<F: VfsFile> WalBackendAdapter<F>
Sourcepub fn with_fec_hook(wal: WalFile<F>, hook: FecCommitHook) -> Self
pub fn with_fec_hook(wal: WalFile<F>, hook: FecCommitHook) -> Self
Wrap an existing WalFile with an FEC commit hook.
Sourcepub fn into_inner(self) -> WalFile<F>
pub fn into_inner(self) -> WalFile<F>
Consume the adapter and return the inner WalFile.
Sourcepub fn inner_mut(&mut self) -> &mut WalFile<F>
pub fn inner_mut(&mut self) -> &mut WalFile<F>
Mutably borrow the inner WalFile.
Invalidates the publication plane since the caller may mutate WAL state.
Sourcepub fn take_fec_pending(&mut self) -> Vec<FecCommitResult>
pub fn take_fec_pending(&mut self) -> Vec<FecCommitResult>
Take any pending FEC commit results for sidecar persistence.
Sourcepub fn fec_enabled(&self) -> bool
pub fn fec_enabled(&self) -> bool
Whether FEC encoding is active.
Sourcepub fn fec_discard(&mut self)
pub fn fec_discard(&mut self)
Discard buffered FEC pages (e.g. on transaction rollback).
Trait Implementations§
Source§impl<F: VfsFile> WalBackend for WalBackendAdapter<F>
impl<F: VfsFile> WalBackend for WalBackendAdapter<F>
Source§fn begin_transaction(&mut self, cx: &Cx) -> Result<()>
fn begin_transaction(&mut self, cx: &Cx) -> Result<()>
Prepare WAL state for a newly-started transaction. Read more
Source§fn append_frame(
&mut self,
cx: &Cx,
page_number: u32,
page_data: &[u8],
db_size_if_commit: u32,
) -> Result<()>
fn append_frame( &mut self, cx: &Cx, page_number: u32, page_data: &[u8], db_size_if_commit: u32, ) -> Result<()>
Append a single frame to the WAL. Read more
Source§fn append_frames(&mut self, cx: &Cx, frames: &[WalFrameRef<'_>]) -> Result<()>
fn append_frames(&mut self, cx: &Cx, frames: &[WalFrameRef<'_>]) -> Result<()>
Append a batch of frames to the WAL. Read more
Source§fn prepare_append_frames(
&mut self,
frames: &[WalFrameRef<'_>],
) -> Result<Option<PreparedWalFrameBatch>>
fn prepare_append_frames( &mut self, frames: &[WalFrameRef<'_>], ) -> Result<Option<PreparedWalFrameBatch>>
Prepare a batch of frames for a later append. Read more
Source§fn finalize_prepared_frames(
&mut self,
_cx: &Cx,
prepared: &mut PreparedWalFrameBatch,
) -> Result<()>
fn finalize_prepared_frames( &mut self, _cx: &Cx, prepared: &mut PreparedWalFrameBatch, ) -> Result<()>
Optionally finalize a prepared batch before the serialized append. Read more
Source§fn append_prepared_frames(
&mut self,
cx: &Cx,
prepared: &mut PreparedWalFrameBatch,
) -> Result<()>
fn append_prepared_frames( &mut self, cx: &Cx, prepared: &mut PreparedWalFrameBatch, ) -> Result<()>
Append a previously prepared frame batch. Read more
Source§fn read_page(&mut self, cx: &Cx, page_number: u32) -> Result<Option<Vec<u8>>>
fn read_page(&mut self, cx: &Cx, page_number: u32) -> Result<Option<Vec<u8>>>
Look up the latest version of a page in the current visible WAL snapshot. Read more
Source§fn committed_txns_since_page(
&mut self,
cx: &Cx,
page_number: u32,
) -> Result<u64>
fn committed_txns_since_page( &mut self, cx: &Cx, page_number: u32, ) -> Result<u64>
Count committed transactions that occur after the latest committed
frame for
page_number in the current visible WAL snapshot. Read moreSource§fn committed_txn_count(&mut self, cx: &Cx) -> Result<u64>
fn committed_txn_count(&mut self, cx: &Cx) -> Result<u64>
Count committed transactions visible in the current WAL snapshot. Read more
Source§fn frame_count(&self) -> usize
fn frame_count(&self) -> usize
Number of valid frames currently in the WAL.
Source§fn checkpoint(
&mut self,
cx: &Cx,
mode: CheckpointMode,
writer: &mut dyn CheckpointPageWriter,
backfilled_frames: u32,
oldest_reader_frame: Option<u32>,
) -> Result<CheckpointResult>
fn checkpoint( &mut self, cx: &Cx, mode: CheckpointMode, writer: &mut dyn CheckpointPageWriter, backfilled_frames: u32, oldest_reader_frame: Option<u32>, ) -> Result<CheckpointResult>
Run a checkpoint to transfer frames from the WAL to the database. Read more
Auto Trait Implementations§
impl<F> Freeze for WalBackendAdapter<F>where
F: Freeze,
impl<F> RefUnwindSafe for WalBackendAdapter<F>where
F: RefUnwindSafe,
impl<F> Send for WalBackendAdapter<F>
impl<F> Sync for WalBackendAdapter<F>
impl<F> Unpin for WalBackendAdapter<F>where
F: Unpin,
impl<F> UnsafeUnpin for WalBackendAdapter<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for WalBackendAdapter<F>where
F: UnwindSafe,
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
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).