pub trait Wal {
Show 20 methods
// Required methods
fn limit(&mut self, size: i64);
fn begin_read_txn(&mut self) -> Result<bool>;
fn end_read_txn(&mut self);
fn find_frame(&mut self, page_no: NonZeroU32) -> Result<Option<NonZeroU32>>;
fn read_frame(
&mut self,
frame_no: NonZeroU32,
buffer: &mut [u8],
) -> Result<()>;
fn read_frame_raw(
&mut self,
frame_no: NonZeroU32,
buffer: &mut [u8],
) -> Result<()>;
fn db_size(&self) -> u32;
fn begin_write_txn(&mut self) -> Result<()>;
fn end_write_txn(&mut self) -> Result<()>;
fn undo<U: UndoHandler>(&mut self, handler: Option<&mut U>) -> Result<()>;
fn savepoint(&mut self, rollback_data: &mut [u32]);
fn savepoint_undo(&mut self, rollback_data: &mut [u32]) -> Result<()>;
fn frame_count(&self, locked: i32) -> Result<u32>;
fn insert_frames(
&mut self,
page_size: c_int,
page_headers: &mut PageHeaders,
size_after: u32,
is_commit: bool,
sync_flags: c_int,
) -> Result<usize>;
fn checkpoint(
&mut self,
db: &mut Sqlite3Db,
mode: CheckpointMode,
busy_handler: Option<&mut dyn BusyHandler>,
sync_flags: u32,
buf: &mut [u8],
checkpoint_cb: Option<&mut dyn CheckpointCallback>,
in_wal: Option<&mut i32>,
backfilled: Option<&mut i32>,
) -> Result<()>;
fn exclusive_mode(&mut self, op: c_int) -> Result<()>;
fn uses_heap_memory(&self) -> bool;
fn set_db(&mut self, db: &mut Sqlite3Db);
fn callback(&self) -> i32;
fn frames_in_wal(&self) -> u32;
}
Required Methods§
Sourcefn begin_read_txn(&mut self) -> Result<bool>
fn begin_read_txn(&mut self) -> Result<bool>
start a read transaction. Returns whether the in-memory page cache should be invalidated.
fn end_read_txn(&mut self)
Sourcefn find_frame(&mut self, page_no: NonZeroU32) -> Result<Option<NonZeroU32>>
fn find_frame(&mut self, page_no: NonZeroU32) -> Result<Option<NonZeroU32>>
locate the frame containing page page_no
Sourcefn read_frame(&mut self, frame_no: NonZeroU32, buffer: &mut [u8]) -> Result<()>
fn read_frame(&mut self, frame_no: NonZeroU32, buffer: &mut [u8]) -> Result<()>
reads frame frame_no
into buffer.
Sourcefn read_frame_raw(
&mut self,
frame_no: NonZeroU32,
buffer: &mut [u8],
) -> Result<()>
fn read_frame_raw( &mut self, frame_no: NonZeroU32, buffer: &mut [u8], ) -> Result<()>
reads frame frame_no
including its frame header into buffer.
fn db_size(&self) -> u32
fn begin_write_txn(&mut self) -> Result<()>
fn end_write_txn(&mut self) -> Result<()>
fn undo<U: UndoHandler>(&mut self, handler: Option<&mut U>) -> Result<()>
fn savepoint(&mut self, rollback_data: &mut [u32])
fn savepoint_undo(&mut self, rollback_data: &mut [u32]) -> Result<()>
fn frame_count(&self, locked: i32) -> Result<u32>
Sourcefn insert_frames(
&mut self,
page_size: c_int,
page_headers: &mut PageHeaders,
size_after: u32,
is_commit: bool,
sync_flags: c_int,
) -> Result<usize>
fn insert_frames( &mut self, page_size: c_int, page_headers: &mut PageHeaders, size_after: u32, is_commit: bool, sync_flags: c_int, ) -> Result<usize>
Insert frames in the wal. On commit, returns the number of inserted frames for that transaction, or 0 for non-commit calls.
Sourcefn checkpoint(
&mut self,
db: &mut Sqlite3Db,
mode: CheckpointMode,
busy_handler: Option<&mut dyn BusyHandler>,
sync_flags: u32,
buf: &mut [u8],
checkpoint_cb: Option<&mut dyn CheckpointCallback>,
in_wal: Option<&mut i32>,
backfilled: Option<&mut i32>,
) -> Result<()>
fn checkpoint( &mut self, db: &mut Sqlite3Db, mode: CheckpointMode, busy_handler: Option<&mut dyn BusyHandler>, sync_flags: u32, buf: &mut [u8], checkpoint_cb: Option<&mut dyn CheckpointCallback>, in_wal: Option<&mut i32>, backfilled: Option<&mut i32>, ) -> Result<()>
Returns the number of frames in the log and the number of checkpointed frames in the WAL.
fn exclusive_mode(&mut self, op: c_int) -> Result<()>
fn uses_heap_memory(&self) -> bool
fn set_db(&mut self, db: &mut Sqlite3Db)
Sourcefn callback(&self) -> i32
fn callback(&self) -> i32
Return the value to pass to a sqlite3_wal_hook callback, the number of frames in the WAL at the point of the last commit since sqlite3WalCallback() was called. If no commits have occurred since the last call, then return 0.
fn frames_in_wal(&self) -> u32
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.