Skip to main content

CatalogSnapshot

Struct CatalogSnapshot 

Source
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: u64

Catalog epoch the snapshot was taken at.

Implementations§

Source§

impl CatalogSnapshot

Source

pub fn from_store(store: &CatalogStore) -> Self

Captures the visible data of store, replacing live payloads with unresolved-live markers.

Source

pub fn to_expr(&self) -> Expr

Emits the deterministic Expr encoding of the snapshot.

Source

pub fn from_expr(expr: Expr) -> Result<Self>

Parses a snapshot from the Expr shape produced by Self::to_expr.

Source

pub fn rows( &self, table: &Symbol, ) -> Option<&BTreeMap<Symbol, CatalogSnapshotRow>>

Returns the snapshot rows of table by key, if any.

Trait Implementations§

Source§

impl Clone for CatalogSnapshot

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl Debug for CatalogSnapshot

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for CatalogSnapshot

Source§

impl PartialEq for CatalogSnapshot

Source§

fn eq(&self, other: &CatalogSnapshot) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for CatalogSnapshot

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.