Rust · Snapshots

Snapshots

use ustore::SaveConfig;use ustore::Snapshot;use ustore::db::Save; 1.0.0-rc.1 · d6d40961

API

StructSaveConfigWhere a save writes and how it reports; see On::save.
db.rs:4359 ↗
pub struct SaveConfig<'config, Path>

Fields

pathPathThe directory of the new database.
progressOption<&'config mut ProgressCallback<'config>>Reports the bytes saved and stops wherever it says to, removing what the save wrote.

Implements

From<Path>
StructSnapshotA point-in-time view of the whole database, which pins the versions its reads need until it is dropped.5
db.rs:4279 ↗
pub struct Snapshot<'db>

Every view at a snapshot borrows it, so the snapshot outlives them, and the snapshot borrows its database, which it is freed before. Dropping it waits for every deferred call naming it to finish.

Implements

Debug, Drop, Send
viewThe view every call at this snapshot addresses, which no write may go through.
db.rs:4287 ↗
pub fn view(&self) -> On<'_, Snapshot<'db>>
onThe view of this snapshot with every call through it running on executor.
db.rs:4301 ↗
pub fn on<'with>(&'with self, executor: &'with Executor) -> On<'with, Snapshot<'db>>
deferredThe view of this snapshot with every verb deferred on executor.
db.rs:4306 ↗
pub fn deferred<'with>(&'with self, executor: &'with Executor) -> DeferredOn<'with, Snapshot<'db>>
read_stampThe stamp this snapshot reads at, at or above the commit stamp of every commit it sees.
db.rs:4311 ↗
pub fn read_stamp(&self) -> ReadStamp
saveWrites this snapshot out as a new database of the same engine; see On::save.
db.rs:4316 ↗
pub fn save<'config, Path: AsRef<str>>(
    &self,
    config: impl Into<SaveConfig<'config, Path>>,
) -> Result<()>
StructSaveA save of a snapshot as a database of its own; see On::save.
db.rs:4374 ↗
pub struct Save<'progress, Path>

Implements

Debug