pub struct Schema {
pub version: String,
pub description: String,
pub tables: HashMap<String, TableDefinition>,
}Expand description
A parsed schema containing table and field definitions.
Fields§
§version: StringSchema version
description: StringSchema description
tables: HashMap<String, TableDefinition>Table definitions indexed by name
Implementations§
Source§impl Schema
impl Schema
Sourcepub fn from_str(schema_toml: &str) -> Result<Self, ValidationError>
pub fn from_str(schema_toml: &str) -> Result<Self, ValidationError>
Parse a schema from TOML string
Note: This is similar to FromStr::from_str but returns our custom error type
Sourcepub fn find_table(&self, table_path: &str) -> Option<&TableDefinition>
pub fn find_table(&self, table_path: &str) -> Option<&TableDefinition>
Find a table definition that matches the given table path.
This handles both exact matches and pattern matches (e.g., “network.*” matches “network.default”).
Sourcepub fn matches_pattern(&self, table_path: &str, pattern: &str) -> bool
pub fn matches_pattern(&self, table_path: &str, pattern: &str) -> bool
Check if a table path matches a pattern table name.
For example, “network.default” matches pattern “network.*”
Sourcepub fn get_concrete_tables(&self) -> impl Iterator<Item = &TableDefinition>
pub fn get_concrete_tables(&self) -> impl Iterator<Item = &TableDefinition>
Get all tables that should be validated
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Schema
impl RefUnwindSafe for Schema
impl Send for Schema
impl Sync for Schema
impl Unpin for Schema
impl UnwindSafe for Schema
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