pub struct Catalog {
pub tables: Vec<RegisteredTable>,
pub edges: Vec<RegisteredEdge>,
pub filter_columns: Vec<FilterColumn>,
}Expand description
In-memory catalog of registered tables, edges, and filter columns.
Fields§
§tables: Vec<RegisteredTable>Registered node tables.
edges: Vec<RegisteredEdge>Registered edge mappings.
filter_columns: Vec<FilterColumn>Optional filter columns indexed at query time.
Implementations§
Source§impl Catalog
impl Catalog
Sourcepub const fn validate_for_build(&self) -> Result<(), CatalogError>
pub const fn validate_for_build(&self) -> Result<(), CatalogError>
Returns whether registration is sufficient to run a snapshot rebuild.
§Errors
Returns CatalogError::EmptyCatalog when no tables are registered.
§Performance
This method is O(1).
Sourcepub fn add_table(&mut self, table: RegisteredTable) -> Result<(), CatalogError>
pub fn add_table(&mut self, table: RegisteredTable) -> Result<(), CatalogError>
Registers a node table after validating uniqueness.
§Errors
Returns CatalogError when ids or names collide.
§Performance
This method is O(t) where t is the number of registered tables.
Sourcepub fn add_edge(&mut self, edge: RegisteredEdge) -> Result<(), CatalogError>
pub fn add_edge(&mut self, edge: RegisteredEdge) -> Result<(), CatalogError>
Registers an edge mapping after validating endpoint tables exist.
§Errors
Returns CatalogError when endpoints are missing or ids collide.
§Performance
This method is O(t + e).
Sourcepub fn add_filter_column(
&mut self,
column: FilterColumn,
) -> Result<(), CatalogError>
pub fn add_filter_column( &mut self, column: FilterColumn, ) -> Result<(), CatalogError>
Registers a filter column for search indexing.
§Errors
Returns CatalogError when the table id is unknown.
§Performance
This method is O(t + f).
Sourcepub fn table(&self, id: TableId) -> Option<&RegisteredTable>
pub fn table(&self, id: TableId) -> Option<&RegisteredTable>
Looks up a registered table by id.
Sourcepub fn from_registration_rows(
tables: impl IntoIterator<Item = RegisteredTable>,
edges: impl IntoIterator<Item = RegisteredEdge>,
filter_columns: impl IntoIterator<Item = FilterColumn>,
) -> Result<Self, CatalogError>
pub fn from_registration_rows( tables: impl IntoIterator<Item = RegisteredTable>, edges: impl IntoIterator<Item = RegisteredEdge>, filter_columns: impl IntoIterator<Item = FilterColumn>, ) -> Result<Self, CatalogError>
Hydrates a catalog from registration rows (SPI adapters collect rows first).
§Errors
Returns CatalogError when any registration row violates catalog invariants.
§Performance
This method is O(t + e + f) for table, edge, and filter row counts.