pub struct BoundedStructuralSnapshot<'a> { /* private fields */ }Expand description
A pinned, structurally-proven snapshot of an external database image.
Returned by Connection::begin_bounded_structural_snapshot. While this
guard is alive, one deferred transaction holds the proven snapshot open;
read it through Self::connection.
Finish with Self::finish. It releases the transaction and then proves
the image never changed during the window — the second half of the
compare-and-swap that makes work derived from this snapshot publishable.
Dropping the guard without calling finish releases the reader but performs
no such proof, so anything derived from the snapshot is unverified; the drop
path logs an error rather than failing silently.
Implementations§
Source§impl BoundedStructuralSnapshot<'_>
impl BoundedStructuralSnapshot<'_>
Sourcepub fn connection(&self) -> &Connection
pub fn connection(&self) -> &Connection
The identity-bound, read-only connection holding the proven snapshot.
Every read of the validated image must go through this connection.
Sourcepub const fn stats(&self) -> &BoundedDatabaseStructuralStats
pub const fn stats(&self) -> &BoundedDatabaseStructuralStats
Structural proof counters for the pinned image.
Sourcepub async fn finish(self) -> Result<()>
pub async fn finish(self) -> Result<()>
Release the snapshot and prove the image never changed during it.
Rolls back the pinned transaction, closes the identity-bound handle, and re-reads the whole-image receipt. Errors are reported in that order, so a validation-window failure is never masked by a teardown failure.
§Errors
Returns FrankenError::BusySnapshot if the image changed while the
snapshot was open, plus any rollback or close error.