pub trait Source {
// Required methods
fn read_at(&self, offset: u64, buf: &mut [u8]) -> Result<()>;
fn len(&self) -> Result<u64>;
// Provided methods
fn is_empty(&self) -> Result<bool> { ... }
fn accounts_for_wal(&self) -> bool { ... }
}Required Methods§
Provided Methods§
fn is_empty(&self) -> Result<bool>
Sourcefn accounts_for_wal(&self) -> bool
fn accounts_for_wal(&self) -> bool
Whether this source has already accounted for a write-ahead log.
A wal mode database is only complete in its main file once the log has been checkpointed into it, and bytes alone cannot say whether that happened. A source that knows, because it looked next to the file or because it reads the log itself, says so here; everything else stays conservative and a wal mode database read through it is refused rather than silently truncated to an older version.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".