Expand description
This module contains various representations of a single catalog update and the logic necessary for converting between representations.
The general lifecycle of a single update when read from persist is as follows:
- The update is stored in persist as a
PersistStateUpdate. - After being read from persist the update is immediately converted into a
StateUpdate<StateUpdateKindJson>, which models the update as a JSON. - The
StateUpdateKindJsonis converted into a protobuf message,proto::StateUpdateKind. - The update is then converted into a
StateUpdate<StateUpdateKind>, which is a strongly typed Rust object. - Finally, the update is converted into an
Option<memory::objects::StateUpdate>, andSomevariants are given to the in-memory catalog. The in-memory catalog is only interested in a subset of catalog updates which is why theOptionis necessary.
TLDR: PersistStateUpdate -> StateUpdate<StateUpdateKindJson> ->
proto::StateUpdateKind -> StateUpdate<StateUpdateKind> ->
Option<memory::objects::StateUpdate>
The process of writing a catalog update to persist is the exact opposite.
When running catalog protobuf upgrades/migrations we may need to take a detour and convert the
StateUpdateKindJson to some proto::object_v{x}::StateUpdateKind before applying specific
upgrades to get us to a valid proto::StateUpdateKind.
Structs§
- State
Update - A single update to the catalog state.
- State
Update Kind Json - Version of
StateUpdateKindto allow reading/writing raw json from/to persist.
Enums§
- State
Update Kind - The contents of a single state update.
Traits§
- Into
State Update Kind Json - Trait for objects that can be converted to/from a
StateUpdateKindJson. - TryInto
State 🔒Update Kind - Trait for objects that can be converted to/from a
StateUpdateKind.
Type Aliases§
- Persist
State 🔒Update - Version of
StateUpdateKindthat is stored directly in persist.