pub struct CatalogSnapshot {
pub tables: BTreeMap<Symbol, CatalogTableSpec>,
pub rows: BTreeMap<Symbol, BTreeMap<Symbol, CatalogSnapshotRow>>,
pub sequences: BTreeMap<Symbol, u64>,
pub epoch: u64,
}Expand description
A deterministic, point-in-time copy of a CatalogStore’s data.
Snapshots carry table specs, row data, sequences, and the catalog epoch. Live
host payloads (runtime values, tests) are not serialized; their fields become
catalog/unresolved-live markers. See the README section “Snapshots and
deltas”.
§Examples
let store = CatalogStore::new();
let snapshot = CatalogSnapshot::from_store(&store);
// Snapshots round-trip through a deterministic Expr form.
let restored = CatalogSnapshot::from_expr(snapshot.to_expr()).unwrap();
assert_eq!(restored, snapshot);Fields§
§tables: BTreeMap<Symbol, CatalogTableSpec>Installed table specs by name.
rows: BTreeMap<Symbol, BTreeMap<Symbol, CatalogSnapshotRow>>Snapshot rows by table and key.
sequences: BTreeMap<Symbol, u64>Sequence values by name.
epoch: u64Catalog epoch the snapshot was taken at.
Implementations§
Source§impl CatalogSnapshot
impl CatalogSnapshot
Sourcepub fn from_store(store: &CatalogStore) -> Self
pub fn from_store(store: &CatalogStore) -> Self
Captures the visible data of store, replacing live payloads with
unresolved-live markers.
Trait Implementations§
Source§impl Clone for CatalogSnapshot
impl Clone for CatalogSnapshot
Source§fn clone(&self) -> CatalogSnapshot
fn clone(&self) -> CatalogSnapshot
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CatalogSnapshot
impl Debug for CatalogSnapshot
impl Eq for CatalogSnapshot
Source§impl PartialEq for CatalogSnapshot
impl PartialEq for CatalogSnapshot
Source§fn eq(&self, other: &CatalogSnapshot) -> bool
fn eq(&self, other: &CatalogSnapshot) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CatalogSnapshot
Auto Trait Implementations§
impl Freeze for CatalogSnapshot
impl RefUnwindSafe for CatalogSnapshot
impl Send for CatalogSnapshot
impl Sync for CatalogSnapshot
impl Unpin for CatalogSnapshot
impl UnsafeUnpin for CatalogSnapshot
impl UnwindSafe for CatalogSnapshot
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