Mojo · Snapshots

Snapshots

from ustore import Snapshot 1.0.0-rc.1 · d6d40961

API

StructSnapshotA point-in-time state of the whole database, released when it goes out of scope. It pins the versions its reads need and holds its database open.4
struct Snapshot

Verbs called on it read at its state on the calling thread; writes, carrying no transaction, land at the head. snap.on(executor) and snap.deferred(executor) route the same verbs to an executor.

Fields

libraryLibraryThe loaded engine.
databaseAddressThe ustore_database_t it belongs to.
addressAddressThe opaque ustore_snapshot_t.
read_stampStampThe stamp the snapshot reads at.

Conforms to

BlobsVerbs, DatabaseVerbs, Deinitable, DocsVerbs, GraphVerbs, Movable, PagesVerbs, StringsVerbs
__init__Adopts a snapshot the engine just pinned.
def __init__(out self, *, library: Library, database: Int, address: Int, read_stamp: Stamp)
__deinit__Releases the snapshot. Calls ustore_snapshot_free.
def __deinit__(deinit self)
onThe same verbs, blocking on executor. Binding-only.
def on(ref self, ref executor: Executor) -> On[origin_of(executor, self)]
deferredThe same verbs, each submitted to executor and answering a Deferred at once. Binding-only.
def deferred(ref self, ref executor: Executor) -> DeferredOn[origin_of(executor, self)]