pub struct SourceSpec { /* private fields */ }Expand description
The enabled indexes a source must build, each paired with its schema.
Everything here is treated as live — disabled indexes are dropped by the
composition root when it translates the config into this spec, so the source
never has to re-check an enabled flag.
Implementations§
Source§impl SourceSpec
impl SourceSpec
Sourcepub fn new(indexes: BTreeMap<IndexName, IndexSchema>) -> Self
pub fn new(indexes: BTreeMap<IndexName, IndexSchema>) -> Self
Build a spec from an explicit set of (index, schema) pairs. Every entry
is treated as live; the caller (the composition root) is responsible for
having filtered out disabled indexes when translating from a config.
Sourcepub fn indexes(&self) -> impl Iterator<Item = (&IndexName, &IndexSchema)>
pub fn indexes(&self) -> impl Iterator<Item = (&IndexName, &IndexSchema)>
Iterate the indexes and their schemas, in index-name order.
pub fn schema(&self, index: &IndexName) -> Option<&IndexSchema>
Sourcepub fn index_mappings(&self) -> Vec<IndexMapping>
pub fn index_mappings(&self) -> Vec<IndexMapping>
Project every index into its fully-typed IndexMapping, using only the
declared schema — the database-free counterpart the engine creates
indexes from up front.
Sourcepub fn all_tables(&self) -> BTreeSet<QualifiedTable>
pub fn all_tables(&self) -> BTreeSet<QualifiedTable>
Every table any enabled index reads — each index’s root table plus every
table a join or aggregate (and any through junction) pulls from.
Relations carry no schema of their own; the resolver qualifies a related
table with the index’s db_schema (see the Postgres resolve module),
so this does the same. This is the set a source must be able to stream —
what CaptureProvisioning checks coverage
against.
Trait Implementations§
Source§impl Clone for SourceSpec
impl Clone for SourceSpec
Source§fn clone(&self) -> SourceSpec
fn clone(&self) -> SourceSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more