pub struct WalSource<S: Source, W: Source> { /* private fields */ }Expand description
A database file with its log read on top of it.
This is a Source, not a special case inside the reader: a page that
the log holds a committed version of is served from there, everything
else from the main file, and nothing above this line has to know that a
log exists at all. The reader that walks b-trees is the same code
either way.
Reads are split at page boundaries before being served, so a caller that asks for a range spanning two pages gets each half from wherever that page currently lives.
Implementations§
Trait Implementations§
Source§impl<S: Source, W: Source> Source for WalSource<S, W>
impl<S: Source, W: Source> Source for WalSource<S, W>
Source§fn accounts_for_wal(&self) -> bool
fn accounts_for_wal(&self) -> bool
This source reads the log, so a wal mode database read through it is complete by construction.
Source§fn read_at(&self, offset: u64, buf: &mut [u8]) -> Result<()>
fn read_at(&self, offset: u64, buf: &mut [u8]) -> Result<()>
Read exactly
buf.len() bytes at offset. Reading past the end is
an error; short reads are never returned.fn is_empty(&self) -> Result<bool>
Auto Trait Implementations§
impl<S, W> Freeze for WalSource<S, W>
impl<S, W> RefUnwindSafe for WalSource<S, W>
impl<S, W> Send for WalSource<S, W>
impl<S, W> Sync for WalSource<S, W>
impl<S, W> Unpin for WalSource<S, W>
impl<S, W> UnsafeUnpin for WalSource<S, W>
impl<S, W> UnwindSafe for WalSource<S, W>
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